Ejemplo n.º 1
0
 @Override
 public void writeExternal(ObjectOutput out) throws IOException {
   String typeName = type.getName();
   out.writeInt(typeName.length());
   out.writeChars(typeName);
   out.writeObject(arg);
 }
Ejemplo n.º 2
0
 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;
   }
 }
Ejemplo n.º 3
0
 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);
   }
 }
Ejemplo n.º 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);
   }
 }
Ejemplo n.º 5
0
 public void writeChars(String s) throws IOException {
   oo.writeChars(s);
 }