Changeset 4015


Ignore:
Timestamp:
Oct 31, 2008, 1:25:56 AM (12 years ago)
Author:
orlov
Message:
  • Working version of Serialize library.
Location:
to-imperative/trunk/java
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • to-imperative/trunk/java/java/org/refal/plus/objects/Box.java

    r3724 r4015  
    33package org.refal.plus.objects;
    44
     5import java.io.Serializable;
     6
    57import org.refal.plus.Expr;
    68
    7 public class Box {
     9public class Box implements Serializable {
     10    private static final long serialVersionUID = 57;
     11
    812    public Expr expr;
    913
  • to-imperative/trunk/java/refal/refal/plus/Serialize.rf

    r4013 r4015  
    11$module "refal.plus.Serialize";
    22
    3 $public $func FileOutputStream e.fileName = s.stream;
     3$use Box StdIO;
     4
     5$public $func FileOutputStream s.fileName = s.stream;
    46$native FileOutputStream = "java.io.FileOutputStream (java.lang.String)";
    57
    68$public $func ObjectOutputStream s.fileStream = s.objectStream;
    7 $native ObjectOutputStream = "java.io.ObjectOutputStream (java.io.FileOutputStream)";
     9$native ObjectOutputStream = "java.io.ObjectOutputStream (java.io.OutputStream)";
    810
    9 $public $func Write s.objectStream e.expr = ;
    10 $native Write = "void java.io.ObjectOutputStream.writeObject (java.io.ObjectOutputStream, java.lang.Object)";
     11$public $func CloseOutputStream s.objectStream = ;
     12$native CloseOutputStream = "void java.io.ObjectOutputStream.close ()";
     13
     14$public $func Write s.objectStream s.box = ;
     15$native Write = "void java.io.ObjectOutputStream.writeObject (java.lang.Object)";
     16
     17$public $func FileInputStream s.fileName = s.stream;
     18$native FileInputStream = "java.io.FileInputStream (java.lang.String)";
     19
     20$public $func ObjectInputStream s.fileStream = s.objectStream;
     21$native ObjectInputStream = "java.io.ObjectInputStream (java.io.InputStream)";
     22
     23$public $func CloseInputStream s.objectStream = ;
     24$native CloseInputStream = "void java.io.ObjectInputStream.close ()";
     25
     26$public $func Read s.objectStream = s.box;
     27$native Read = "java.lang.Object java.io.ObjectInputStream.readObject ()";
    1128
    1229$func Main = e;
    13 Main = <Write <ObjectOutputStream <FileOutputStream 'x'>> 123>;
     30Main =
     31  <ObjectOutputStream <FileOutputStream "x">> :: s.out,
     32  <Write s.out <Box 12 () (-3) (A B 'A' ('B'))>>,
     33  <CloseOutputStream s.out>,
     34  <ObjectInputStream <FileInputStream "x">> :: s.in,
     35  <Read s.in> :: s.box,
     36  <WriteLn s.box>,
     37  <WriteLn <Get s.box>>,
     38  <CloseInputStream s.in>;
Note: See TracChangeset for help on using the changeset viewer.