@Override
 public void writeExternal(ObjectOutput out) throws IOException {
   String typeName = type.getName();
   out.writeInt(typeName.length());
   out.writeChars(typeName);
   out.writeObject(arg);
 }
示例#2
0
文件: FIO.java 项目: donkang/statet
 public void writeString(final String s) throws IOException {
   final ObjectOutput out = this.out;
   if (s != null) {
     final int cn = s.length();
     ASCII:
     if (cn <= BA_LENGTH) {
       for (int ci = 0; ci < cn; ) {
         if ((s.charAt(ci++) & 0xffffff00) != 0) {
           break ASCII;
         }
       }
       if (cn <= 8) {
         out.writeInt(-cn);
         out.writeBytes(s);
         return;
       } else {
         out.writeInt(-cn);
         s.getBytes(0, cn, this.ba, 0);
         out.write(this.ba, 0, cn);
         return;
       }
     }
     out.writeInt(cn);
     out.writeChars(s);
     return;
   } else {
     out.writeInt(Integer.MIN_VALUE);
     return;
   }
 }
 void writeObj(ObjectOutput out) throws IOException {
   out.writeInt(numSymbols());
   for (int i = 0; i < numSymbols(); ++i) {
     String symbol = idToSymbol(i);
     out.writeShort(symbol.length());
     out.writeChars(symbol);
   }
 }
示例#4
0
 @Override
 public void writeExternal(ObjectOutput out) throws IOException {
   out.writeInt(pos);
   for (int i = 0; i < pos; i++) {
     String name = classLookup[i].getName();
     out.writeInt(name.length());
     out.writeChars(name);
   }
 }
 public void writeChars(String s) throws IOException {
   oo.writeChars(s);
 }