[BACK]Return to CMO_DATUM.java CVS log [TXT][DIR] Up to [local] / OpenXM / src / OpenMath / ORG / openxm / tam

Annotation of OpenXM/src/OpenMath/ORG/openxm/tam/CMO_DATUM.java, Revision 1.2

1.1       tam         1: /**
1.2     ! tam         2:  * $OpenXM: OpenXM/src/OpenMath/ORG/openxm/tam/CMO_DATUM.java,v 1.1 2000/09/12 07:05:05 tam Exp $
1.1       tam         3:  */
                      4: package ORG.openxm.tam;
                      5:
                      6: import java.io.*;
                      7:
                      8: /**
                      9:  * CMO $B7A<0$N(B DATUM $B7?$rI=$7$^$9(B.
                     10:  */
                     11: public class CMO_DATUM extends CMO{
                     12:   private byte data[];
                     13:
                     14:   /**
                     15:    * in[] $B$rFbMF$H$9$k(B DATUM $B7?$r:n@.$7$^$9(B.
                     16:    */
                     17:   CMO_DATUM(byte in[]){
                     18:     data = in;
                     19:   }
                     20:
                     21:   public int DISCRIMINATOR(){
                     22:     return DATUM;
                     23:   }
                     24:
1.2     ! tam        25:   public void sendByObject(OpenXMstream os) throws IOException{
1.1       tam        26:     os.writeInt(data.length);
                     27:     for(int i=0;i<data.length;i++){
                     28:       os.writeByte(data[i]);
                     29:     }
                     30:   }
                     31:
1.2     ! tam        32:   static protected CMO receive(OpenXMstream is) throws IOException{
1.1       tam        33:     int len;
                     34:     byte[] data;
                     35:
                     36:     len = is.readInt();
                     37:     data = new byte[len];
                     38:
                     39:     for(int i=0;i<len;i++){
                     40:       data[i] = is.readByte();
                     41:     }
                     42:
                     43:     return new CMO_DATUM(data);
                     44:   }
                     45:
                     46:   public String toCMOexpressionByObject(){
                     47:     String str = "";
                     48:
                     49:     for(int i=0;i<data.length;i++){
                     50:       str += ","+ data[i];
                     51:     }
                     52:
                     53:     return "CMO_DATUM,"+ data.length + str;
                     54:   }
                     55: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>