home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1999 April / DPPCPRO0499.ISO / April / Notes / 50b2wic.exe / DATA1.CAB / NotesProgramFilesJavaSupport / rt.jar / java / io / ObjectOutputStream.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-04-23  |  11.6 KB  |  691 lines

  1. package java.io;
  2.  
  3. import java.util.Stack;
  4. import sun.io.ObjectOutputStreamDelegate;
  5.  
  6. public class ObjectOutputStream extends OutputStream implements ObjectOutput, ObjectStreamConstants {
  7.    private boolean blockDataMode;
  8.    private byte[] buf;
  9.    private int count;
  10.    private OutputStream out;
  11.    private DataOutputStream dos;
  12.    private IOException abortIOException;
  13.    private Object[] wireHandle2Object;
  14.    private int[] wireNextHandle;
  15.    private int[] wireHash2Handle;
  16.    private int nextWireOffset;
  17.    private Object currentObject;
  18.    private ObjectStreamClass currentClassDesc;
  19.    private Stack classDescStack;
  20.    boolean enableReplace;
  21.    private Object[] replaceObjects;
  22.    private int nextReplaceOffset;
  23.    private int recursionDepth;
  24.    private boolean isTrustedSubclass = false;
  25.  
  26.    public ObjectOutputStream(OutputStream var1) throws IOException {
  27.       if (this instanceof ObjectOutputStreamDelegate && this.getClass().getClassLoader() == null) {
  28.          this.isTrustedSubclass = true;
  29.       } else {
  30.          this.out = var1;
  31.          this.dos = new DataOutputStream(this);
  32.          this.buf = new byte[1024];
  33.          this.writeStreamHeader();
  34.          this.resetStream();
  35.       }
  36.    }
  37.  
  38.    public final void writeObject(Object var1) throws IOException {
  39.       if (this.isTrustedSubclass) {
  40.          ((ObjectOutputStreamDelegate)this).writeObjectDelegate(var1);
  41.       } else {
  42.          Object var2 = this.currentObject;
  43.          ObjectStreamClass var3 = this.currentClassDesc;
  44.          boolean var4 = this.setBlockData(false);
  45.          ++this.recursionDepth;
  46.  
  47.          try {
  48.             if (this.serializeNullAndRepeat(var1)) {
  49.                return;
  50.             }
  51.  
  52.             if (this.checkSpecialClasses(var1)) {
  53.                return;
  54.             }
  55.  
  56.             if (this.enableReplace) {
  57.                Object var17 = this.replaceObject(var1);
  58.                if (var1 != var17) {
  59.                   if (var17 != null && !(var17 instanceof Serializable)) {
  60.                      String var8 = var17.getClass().getName();
  61.                      throw new NotSerializableException(var8);
  62.                   }
  63.  
  64.                   if (this.serializeNullAndRepeat(var17)) {
  65.                      this.addReplacement(var1, var17);
  66.                      return;
  67.                   }
  68.  
  69.                   this.addReplacement(var1, var17);
  70.                   if (this.checkSpecialClasses(var17)) {
  71.                      return;
  72.                   }
  73.  
  74.                   var1 = var17;
  75.                }
  76.             }
  77.  
  78.             if (this.checkSubstitutableSpecialClasses(var1)) {
  79.                return;
  80.             }
  81.  
  82.             this.outputObject(var1);
  83.          } catch (ObjectStreamException var14) {
  84.             ObjectStreamException var7 = var14;
  85.             if (this.abortIOException == null) {
  86.                try {
  87.                   this.setBlockData(false);
  88.                   this.writeCode(123);
  89.                   this.resetStream();
  90.                   this.writeObject(var7);
  91.                   this.resetStream();
  92.                   this.abortIOException = var7;
  93.                } catch (IOException var13) {
  94.                   this.abortIOException = new StreamCorruptedException(((Throwable)var13).getMessage());
  95.                }
  96.             }
  97.          } catch (IOException var15) {
  98.             if (this.abortIOException == null) {
  99.                this.abortIOException = var15;
  100.             }
  101.          } finally {
  102.             --this.recursionDepth;
  103.             this.currentObject = var2;
  104.             this.currentClassDesc = var3;
  105.             this.setBlockData(var4);
  106.          }
  107.  
  108.          IOException var5 = this.abortIOException;
  109.          if (this.recursionDepth == 0) {
  110.             this.abortIOException = null;
  111.          }
  112.  
  113.          if (var5 != null) {
  114.             throw var5;
  115.          }
  116.       }
  117.    }
  118.  
  119.    private boolean checkSpecialClasses(Object var1) throws IOException {
  120.       if (var1 instanceof Class) {
  121.          this.outputClass((Class)var1);
  122.          return true;
  123.       } else if (var1 instanceof ObjectStreamClass) {
  124.          this.outputClassDescriptor((ObjectStreamClass)var1);
  125.          return true;
  126.       } else {
  127.          return false;
  128.       }
  129.    }
  130.  
  131.    private boolean checkSubstitutableSpecialClasses(Object var1) throws IOException {
  132.       if (var1 instanceof String) {
  133.          this.outputString((String)var1);
  134.          return true;
  135.       } else if (var1.getClass().isArray()) {
  136.          this.outputArray(var1);
  137.          return true;
  138.       } else {
  139.          return false;
  140.       }
  141.    }
  142.  
  143.    public final void defaultWriteObject() throws IOException {
  144.       if (this.isTrustedSubclass) {
  145.          ((ObjectOutputStreamDelegate)this).defaultWriteObjectDelegate();
  146.       } else if (this.currentObject != null && this.currentClassDesc != null) {
  147.          if (this.currentClassDesc.getFieldSequence() != null) {
  148.             boolean var1 = this.setBlockData(false);
  149.             this.outputClassFields(this.currentObject, this.currentClassDesc.forClass(), this.currentClassDesc.getFieldSequence());
  150.             this.setBlockData(var1);
  151.          }
  152.  
  153.       } else {
  154.          throw new NotActiveException("defaultWriteObject");
  155.       }
  156.    }
  157.  
  158.    public void reset() throws IOException {
  159.       if (this.currentObject == null && this.currentClassDesc == null) {
  160.          this.setBlockData(false);
  161.          this.writeCode(121);
  162.          this.resetStream();
  163.          this.abortIOException = null;
  164.       } else {
  165.          throw new IOException("Illegal call to reset");
  166.       }
  167.    }
  168.  
  169.    private void resetStream() throws IOException {
  170.       if (this.wireHandle2Object == null) {
  171.          this.wireHandle2Object = new Object[100];
  172.          this.wireNextHandle = new int[100];
  173.          this.wireHash2Handle = new int[101];
  174.       } else {
  175.          for(int var1 = 0; var1 < this.nextWireOffset; ++var1) {
  176.             this.wireHandle2Object[var1] = null;
  177.             this.wireNextHandle[var1] = 0;
  178.          }
  179.       }
  180.  
  181.       this.nextWireOffset = 0;
  182.  
  183.       for(int var3 = 0; var3 < this.wireHash2Handle.length; ++var3) {
  184.          this.wireHash2Handle[var3] = -1;
  185.       }
  186.  
  187.       if (this.classDescStack == null) {
  188.          this.classDescStack = new Stack();
  189.       } else {
  190.          this.classDescStack.setSize(0);
  191.       }
  192.  
  193.       for(int var2 = 0; var2 < this.nextReplaceOffset; ++var2) {
  194.          this.replaceObjects[var2] = null;
  195.       }
  196.  
  197.       this.nextReplaceOffset = 0;
  198.       this.setBlockData(true);
  199.    }
  200.  
  201.    protected void annotateClass(Class var1) throws IOException {
  202.    }
  203.  
  204.    protected Object replaceObject(Object var1) throws IOException {
  205.       return var1;
  206.    }
  207.  
  208.    protected final boolean enableReplaceObject(boolean var1) throws SecurityException {
  209.       if (this.isTrustedSubclass) {
  210.          return ((ObjectOutputStreamDelegate)this).enableReplaceObjectDelegate(var1);
  211.       } else {
  212.          boolean var2 = this.enableReplace;
  213.          if (var1) {
  214.             ClassLoader var3 = this.getClass().getClassLoader();
  215.             if (var3 == null) {
  216.                this.enableReplace = true;
  217.                return var2;
  218.             } else {
  219.                throw new SecurityException("Not trusted class");
  220.             }
  221.          } else {
  222.             this.enableReplace = false;
  223.             return var2;
  224.          }
  225.       }
  226.    }
  227.  
  228.    protected void writeStreamHeader() throws IOException {
  229.       this.writeShort(-21267);
  230.       this.writeShort(5);
  231.    }
  232.  
  233.    private void outputString(String var1) throws IOException {
  234.       this.assignWireOffset(var1);
  235.       this.writeCode(116);
  236.       this.writeUTF(var1);
  237.    }
  238.  
  239.    private void outputClass(Class var1) throws IOException {
  240.       this.writeCode(118);
  241.       ObjectStreamClass var2 = ObjectStreamClass.lookup(var1);
  242.       if (var2 == null) {
  243.          throw new NotSerializableException(var1.getName());
  244.       } else {
  245.          this.outputClassDescriptor(var2);
  246.          this.assignWireOffset(var1);
  247.       }
  248.    }
  249.  
  250.    private void outputClassDescriptor(ObjectStreamClass var1) throws IOException {
  251.       if (!this.serializeNullAndRepeat(var1)) {
  252.          this.writeCode(114);
  253.          String var2 = var1.getName();
  254.          this.writeUTF(var2);
  255.          this.writeLong(var1.getSerialVersionUID());
  256.          this.assignWireOffset(var1);
  257.          var1.write(this);
  258.          boolean var3 = this.setBlockData(true);
  259.          this.annotateClass(var1.forClass());
  260.          this.setBlockData(var3);
  261.          this.writeCode(120);
  262.          ObjectStreamClass var4 = var1.getSuperclass();
  263.          this.outputClassDescriptor(var4);
  264.       }
  265.    }
  266.  
  267.    private void outputArray(Object var1) throws IOException {
  268.       Class var2 = var1.getClass();
  269.       ObjectStreamClass var3 = ObjectStreamClass.lookup(var2);
  270.       this.writeCode(117);
  271.       this.outputClassDescriptor(var3);
  272.       this.assignWireOffset(var1);
  273.       Class var6 = var2.getComponentType();
  274.       if (var6.isPrimitive()) {
  275.          if (var6 == Integer.TYPE) {
  276.             int[] var30 = (int[])var1;
  277.             int var22 = var30.length;
  278.             this.writeInt(var22);
  279.  
  280.             for(int var14 = 0; var14 < var22; ++var14) {
  281.                this.writeInt(var30[var14]);
  282.             }
  283.  
  284.          } else if (var6 == Byte.TYPE) {
  285.             byte[] var29 = (byte[])var1;
  286.             int var21 = var29.length;
  287.             this.writeInt(var21);
  288.             this.writeInternal(var29, 0, var21, true);
  289.          } else if (var6 == Long.TYPE) {
  290.             long[] var28 = (long[])var1;
  291.             int var20 = var28.length;
  292.             this.writeInt(var20);
  293.  
  294.             for(int var13 = 0; var13 < var20; ++var13) {
  295.                this.writeLong(var28[var13]);
  296.             }
  297.  
  298.          } else if (var6 == Float.TYPE) {
  299.             float[] var27 = (float[])var1;
  300.             int var19 = var27.length;
  301.             this.writeInt(var19);
  302.  
  303.             for(int var12 = 0; var12 < var19; ++var12) {
  304.                this.writeFloat(var27[var12]);
  305.             }
  306.  
  307.          } else if (var6 == Double.TYPE) {
  308.             double[] var26 = (double[])var1;
  309.             int var18 = var26.length;
  310.             this.writeInt(var18);
  311.  
  312.             for(int var11 = 0; var11 < var18; ++var11) {
  313.                this.writeDouble(var26[var11]);
  314.             }
  315.  
  316.          } else if (var6 == Short.TYPE) {
  317.             short[] var25 = (short[])var1;
  318.             int var17 = var25.length;
  319.             this.writeInt(var17);
  320.  
  321.             for(int var10 = 0; var10 < var17; ++var10) {
  322.                this.writeShort(var25[var10]);
  323.             }
  324.  
  325.          } else if (var6 == Character.TYPE) {
  326.             char[] var24 = (char[])var1;
  327.             int var16 = var24.length;
  328.             this.writeInt(var16);
  329.  
  330.             for(int var9 = 0; var9 < var16; ++var9) {
  331.                this.writeChar(var24[var9]);
  332.             }
  333.  
  334.          } else if (var6 != Boolean.TYPE) {
  335.             throw new InvalidClassException(var2.getName());
  336.          } else {
  337.             boolean[] var23 = (boolean[])var1;
  338.             int var15 = var23.length;
  339.             this.writeInt(var15);
  340.  
  341.             for(int var8 = 0; var8 < var15; ++var8) {
  342.                this.writeBoolean(var23[var8]);
  343.             }
  344.  
  345.          }
  346.       } else {
  347.          Object[] var7 = var1;
  348.          int var5 = var7.length;
  349.          this.writeInt(var5);
  350.  
  351.          for(int var4 = 0; var4 < var5; ++var4) {
  352.             this.writeObject(var7[var4]);
  353.          }
  354.  
  355.       }
  356.    }
  357.  
  358.    private void outputObject(Object var1) throws IOException {
  359.       this.currentObject = var1;
  360.       Class var2 = var1.getClass();
  361.       this.currentClassDesc = ObjectStreamClass.lookup(var2);
  362.       if (this.currentClassDesc == null) {
  363.          throw new NotSerializableException(var2.getName());
  364.       } else {
  365.          this.writeCode(115);
  366.          this.outputClassDescriptor(this.currentClassDesc);
  367.          this.assignWireOffset(var1);
  368.          if (this.currentClassDesc.isExternalizable()) {
  369.             Externalizable var9 = (Externalizable)var1;
  370.             var9.writeExternal(this);
  371.          } else {
  372.             int var3 = this.classDescStack.size();
  373.  
  374.             try {
  375.                ObjectStreamClass var6;
  376.                while((var6 = this.currentClassDesc.getSuperclass()) != null) {
  377.                   this.classDescStack.push(this.currentClassDesc);
  378.                   this.currentClassDesc = var6;
  379.                }
  380.  
  381.                do {
  382.                   if (this.currentClassDesc.hasWriteObject()) {
  383.                      this.setBlockData(true);
  384.                      this.invokeObjectWriter(var1, this.currentClassDesc.forClass());
  385.                      this.setBlockData(false);
  386.                      this.writeCode(120);
  387.                   } else {
  388.                      this.defaultWriteObject();
  389.                   }
  390.                } while(this.classDescStack.size() > var3 && (this.currentClassDesc = (ObjectStreamClass)this.classDescStack.pop()) != null);
  391.             } finally {
  392.                this.classDescStack.setSize(var3);
  393.             }
  394.  
  395.          }
  396.       }
  397.    }
  398.  
  399.    private boolean serializeNullAndRepeat(Object var1) throws IOException {
  400.       if (var1 == null) {
  401.          this.writeCode(112);
  402.          return true;
  403.       } else {
  404.          if (this.replaceObjects != null) {
  405.             for(int var2 = 0; var2 < this.nextReplaceOffset; var2 += 2) {
  406.                if (this.replaceObjects[var2] == var1) {
  407.                   var1 = this.replaceObjects[var2 + 1];
  408.                   break;
  409.                }
  410.             }
  411.          }
  412.  
  413.          int var3 = this.findWireOffset(var1);
  414.          if (var3 >= 0) {
  415.             this.writeCode(113);
  416.             this.writeInt(var3 + 8257536);
  417.             return true;
  418.          } else {
  419.             return false;
  420.          }
  421.       }
  422.    }
  423.  
  424.    private int findWireOffset(Object var1) {
  425.       int var2 = System.identityHashCode(var1);
  426.       int var3 = (var2 & Integer.MAX_VALUE) % this.wireHash2Handle.length;
  427.  
  428.       for(int var4 = this.wireHash2Handle[var3]; var4 >= 0; var4 = this.wireNextHandle[var4]) {
  429.          if (this.wireHandle2Object[var4] == var1) {
  430.             return var4;
  431.          }
  432.       }
  433.  
  434.       return -1;
  435.    }
  436.  
  437.    private void assignWireOffset(Object var1) throws IOException {
  438.       if (this.nextWireOffset == this.wireHandle2Object.length) {
  439.          Object[] var2 = this.wireHandle2Object;
  440.          this.wireHandle2Object = new Object[this.nextWireOffset * 2];
  441.          System.arraycopy(var2, 0, this.wireHandle2Object, 0, this.nextWireOffset);
  442.          int[] var3 = this.wireNextHandle;
  443.          this.wireNextHandle = new int[this.nextWireOffset * 2];
  444.          System.arraycopy(var3, 0, this.wireNextHandle, 0, this.nextWireOffset);
  445.       }
  446.  
  447.       this.wireHandle2Object[this.nextWireOffset] = var1;
  448.       this.hashInsert(var1, this.nextWireOffset);
  449.       ++this.nextWireOffset;
  450.    }
  451.  
  452.    private void hashInsert(Object var1, int var2) {
  453.       int var3 = System.identityHashCode(var1);
  454.       int var4 = (var3 & Integer.MAX_VALUE) % this.wireHash2Handle.length;
  455.       this.wireNextHandle[var2] = this.wireHash2Handle[var4];
  456.       this.wireHash2Handle[var4] = var2;
  457.    }
  458.  
  459.    private void addReplacement(Object var1, Object var2) {
  460.       if (this.replaceObjects == null) {
  461.          this.replaceObjects = new Object[10];
  462.       }
  463.  
  464.       if (this.nextReplaceOffset == this.replaceObjects.length) {
  465.          Object[] var3 = this.replaceObjects;
  466.          this.replaceObjects = new Object[2 + this.nextReplaceOffset * 2];
  467.          System.arraycopy(var3, 0, this.replaceObjects, 0, this.nextReplaceOffset);
  468.       }
  469.  
  470.       this.replaceObjects[this.nextReplaceOffset++] = var1;
  471.       this.replaceObjects[this.nextReplaceOffset++] = var2;
  472.    }
  473.  
  474.    private void writeCode(int var1) throws IOException {
  475.       this.writeByte(var1);
  476.    }
  477.  
  478.    public void write(int var1) throws IOException {
  479.       if (this.count >= this.buf.length) {
  480.          this.drain();
  481.       }
  482.  
  483.       this.buf[this.count++] = (byte)var1;
  484.    }
  485.  
  486.    public void write(byte[] var1) throws IOException {
  487.       this.write(var1, 0, var1.length);
  488.    }
  489.  
  490.    private void writeInternal(byte[] var1, int var2, int var3, boolean var4) throws IOException {
  491.       if (var3 < 0) {
  492.          throw new IndexOutOfBoundsException();
  493.       } else {
  494.          int var5 = this.buf.length - this.count;
  495.          if (var3 <= var5) {
  496.             System.arraycopy(var1, var2, this.buf, this.count, var3);
  497.             this.count += var3;
  498.          } else if (!this.blockDataMode && var4) {
  499.             this.bufferedWrite(var1, var2, var3);
  500.          } else {
  501.             this.drain();
  502.             if (this.blockDataMode) {
  503.                if (var3 <= 255) {
  504.                   this.out.write(119);
  505.                   this.out.write(var3);
  506.                } else {
  507.                   this.out.write(122);
  508.                   this.out.write(var3 >> 24 & 255);
  509.                   this.out.write(var3 >> 16 & 255);
  510.                   this.out.write(var3 >> 8 & 255);
  511.                   this.out.write(var3 & 255);
  512.                }
  513.             }
  514.  
  515.             this.out.write(var1, var2, var3);
  516.          }
  517.       }
  518.    }
  519.  
  520.    public void flush() throws IOException {
  521.       this.drain();
  522.       this.out.flush();
  523.    }
  524.  
  525.    protected void drain() throws IOException {
  526.       if (this.count != 0) {
  527.          if (this.blockDataMode) {
  528.             if (this.count <= 255) {
  529.                this.out.write(119);
  530.                this.out.write(this.count);
  531.             } else {
  532.                this.out.write(122);
  533.                this.out.write(this.count >> 24 & 255);
  534.                this.out.write(this.count >> 16 & 255);
  535.                this.out.write(this.count >> 8 & 255);
  536.                this.out.write(this.count & 255);
  537.             }
  538.          }
  539.  
  540.          this.out.write(this.buf, 0, this.count);
  541.          this.count = 0;
  542.       }
  543.    }
  544.  
  545.    public void close() throws IOException {
  546.       this.flush();
  547.       this.out.close();
  548.    }
  549.  
  550.    private boolean setBlockData(boolean var1) throws IOException {
  551.       if (this.blockDataMode == var1) {
  552.          return var1;
  553.       } else {
  554.          this.drain();
  555.          this.blockDataMode = var1;
  556.          return !var1;
  557.       }
  558.    }
  559.  
  560.    public void writeBoolean(boolean var1) throws IOException {
  561.       if (this.count >= this.buf.length) {
  562.          this.drain();
  563.       }
  564.  
  565.       this.buf[this.count++] = (byte)(var1 ? 1 : 0);
  566.    }
  567.  
  568.    public void write(byte[] var1, int var2, int var3) throws IOException {
  569.       this.writeInternal(var1, var2, var3, false);
  570.    }
  571.  
  572.    private void bufferedWrite(byte[] var1, int var2, int var3) throws IOException {
  573.       int var4 = this.buf.length - this.count;
  574.       int var5 = var3;
  575.       if (var3 > var4) {
  576.          System.arraycopy(var1, var2, this.buf, this.count, var4);
  577.          var2 += var4;
  578.          var5 = var3 - var4;
  579.          this.out.write(this.buf, 0, this.buf.length);
  580.  
  581.          for(this.count = 0; var5 >= this.buf.length; var5 -= this.buf.length) {
  582.             System.arraycopy(var1, var2, this.buf, 0, this.buf.length);
  583.             this.out.write(this.buf, 0, this.buf.length);
  584.             var2 += this.buf.length;
  585.          }
  586.       }
  587.  
  588.       if (var5 != 0) {
  589.          System.arraycopy(var1, var2, this.buf, this.count, var5);
  590.          this.count += var5;
  591.       }
  592.  
  593.    }
  594.  
  595.    public void writeByte(int var1) throws IOException {
  596.       if (this.count >= this.buf.length) {
  597.          this.drain();
  598.       }
  599.  
  600.       this.buf[this.count++] = (byte)var1;
  601.    }
  602.  
  603.    public void writeShort(int var1) throws IOException {
  604.       if (this.count + 2 > this.buf.length) {
  605.          this.drain();
  606.       }
  607.  
  608.       this.buf[this.count++] = (byte)(var1 >>> 8);
  609.       this.buf[this.count++] = (byte)var1;
  610.    }
  611.  
  612.    public void writeChar(int var1) throws IOException {
  613.       if (this.count + 2 > this.buf.length) {
  614.          this.drain();
  615.       }
  616.  
  617.       this.buf[this.count++] = (byte)(var1 >>> 8);
  618.       this.buf[this.count++] = (byte)var1;
  619.    }
  620.  
  621.    public void writeInt(int var1) throws IOException {
  622.       if (this.count + 4 > this.buf.length) {
  623.          this.drain();
  624.       }
  625.  
  626.       this.buf[this.count++] = (byte)(var1 >>> 24);
  627.       this.buf[this.count++] = (byte)(var1 >>> 16);
  628.       this.buf[this.count++] = (byte)(var1 >>> 8);
  629.       this.buf[this.count++] = (byte)var1;
  630.    }
  631.  
  632.    public void writeLong(long var1) throws IOException {
  633.       if (this.count + 8 > this.buf.length) {
  634.          this.drain();
  635.       }
  636.  
  637.       this.buf[this.count++] = (byte)((int)(var1 >>> 56));
  638.       this.buf[this.count++] = (byte)((int)(var1 >>> 48));
  639.       this.buf[this.count++] = (byte)((int)(var1 >>> 40));
  640.       this.buf[this.count++] = (byte)((int)(var1 >>> 32));
  641.       this.buf[this.count++] = (byte)((int)(var1 >>> 24));
  642.       this.buf[this.count++] = (byte)((int)(var1 >>> 16));
  643.       this.buf[this.count++] = (byte)((int)(var1 >>> 8));
  644.       this.buf[this.count++] = (byte)((int)var1);
  645.    }
  646.  
  647.    public void writeFloat(float var1) throws IOException {
  648.       int var2 = Float.floatToIntBits(var1);
  649.       if (this.count + 4 > this.buf.length) {
  650.          this.drain();
  651.       }
  652.  
  653.       this.buf[this.count++] = (byte)(var2 >>> 24);
  654.       this.buf[this.count++] = (byte)(var2 >>> 16);
  655.       this.buf[this.count++] = (byte)(var2 >>> 8);
  656.       this.buf[this.count++] = (byte)var2;
  657.    }
  658.  
  659.    public void writeDouble(double var1) throws IOException {
  660.       long var3 = Double.doubleToLongBits(var1);
  661.       if (this.count + 8 > this.buf.length) {
  662.          this.drain();
  663.       }
  664.  
  665.       this.buf[this.count++] = (byte)((int)(var3 >>> 56));
  666.       this.buf[this.count++] = (byte)((int)(var3 >>> 48));
  667.       this.buf[this.count++] = (byte)((int)(var3 >>> 40));
  668.       this.buf[this.count++] = (byte)((int)(var3 >>> 32));
  669.       this.buf[this.count++] = (byte)((int)(var3 >>> 24));
  670.       this.buf[this.count++] = (byte)((int)(var3 >>> 16));
  671.       this.buf[this.count++] = (byte)((int)(var3 >>> 8));
  672.       this.buf[this.count++] = (byte)((int)var3);
  673.    }
  674.  
  675.    public void writeBytes(String var1) throws IOException {
  676.       this.dos.writeBytes(var1);
  677.    }
  678.  
  679.    public void writeChars(String var1) throws IOException {
  680.       this.dos.writeChars(var1);
  681.    }
  682.  
  683.    public void writeUTF(String var1) throws IOException {
  684.       this.dos.writeUTF(var1);
  685.    }
  686.  
  687.    private native void outputClassFields(Object var1, Class var2, int[] var3) throws IOException, InvalidClassException;
  688.  
  689.    private native boolean invokeObjectWriter(Object var1, Class var2) throws IOException;
  690. }
  691.