Package java.io.ObjectOutputStream

Examples of java.io.ObjectOutputStream.PutField


    switch (writeMode) {
    case DEFAULT:
      oos.defaultWriteObject();
      break;
    case FIELD:
      final PutField putField = oos.putFields();
      putField.put("object1", object1);
      putField.put("object2", object2);
      putField.put("value", value);
      putField.put("notPrimitiveValue", notPrimitiveValue);
      oos.writeFields();
      break;
    case ONE_BY_ONE:
      if (unshared) {
        oos.writeUnshared(object1);
View Full Code Here


   }

   private void writeObject(ObjectOutputStream out)
      throws IOException
   {
      PutField fields = out.putFields();
      fields.put("rootURI", getLocalVFSContext().getRootURI());
      fields.put("parent", parent);
      fields.put("name", name);
      fields.put("vfsUrl", vfsUrl);
      out.writeFields();
   }
View Full Code Here

    * @throws IOException
    */
   private void writeObject(ObjectOutputStream out)
      throws IOException
   {
      PutField fields = out.putFields();

      byte[] zisBytes;
      ZipInputStream jarStream = zis;
      if(jarStream == null)
      {
         // Need to obtain this nested jar input stream from parent
         InputStream parentIS = super.getParent().openStream();
         if(parentIS == null)
            throw new IOException("Failed to open parent stream, "+this);
         jarStream = new ZipInputStream(parentIS);
         // First find our entry
         ZipEntry entry = jarStream.getNextEntry();
         while(entry != null)
         {
            if(entry.getName().equals(getName()))
               break;
            entry = jarStream.getNextEntry();
         }
         if(entry == null)
            throw new IOException("Failed to find nested jar entry: "+this.getName()+" in parent: "+getParent());
      }
      // Now read zis for this entry
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      byte[] tmp = new byte[1024];
      int length = jarStream.read(tmp);
      while(length > 0)
      {
         baos.write(tmp, 0, length);
         length = jarStream.read(tmp);
      }
      jarStream.close();
      jarStream = null;
      zisBytes = baos.toByteArray();
      fields.put("zisBytes", zisBytes);
      fields.put("jarURL", jarURL);
      fields.put("entryURL", entryURL);
      fields.put("lastModified", lastModified);
      fields.put("size", size);
      out.writeFields();
   }
View Full Code Here

   }

   private void writeObject(ObjectOutputStream out)
      throws IOException
   {
      PutField fields = out.putFields();
      fields.put("rootURI", this.getVFSContext().getRootURI());
      fields.put("parent", parent);
      fields.put("name", name);
      fields.put("vfsUrl", vfsUrl);
      out.writeFields();
   }
View Full Code Here

   }

   private void writeObject(ObjectOutputStream out)
      throws IOException
   {
      PutField fields = out.putFields();
      fields.put("rootURI", this.getVFSContext().getRootURI());
      fields.put("parent", parent);
      fields.put("name", name);
      fields.put("vfsUrl", vfsUrl);
      out.writeFields();
   }
View Full Code Here

   }

   private void writeObject(ObjectOutputStream out)
      throws IOException
   {
      PutField fields = out.putFields();
      fields.put("rootURI", this.getVFSContext().getRootURI());
      fields.put("parent", parent);
      fields.put("name", name);
      out.writeFields();
   }
View Full Code Here

   }

   private void writeObject(ObjectOutputStream out)
      throws IOException
   {
      PutField fields = out.putFields();
      fields.put("rootURI", getLocalVFSContext().getRootURI());
      fields.put("parent", parent);
      fields.put("name", name);
      fields.put("vfsUrl", vfsUrl);
      out.writeFields();
   }
View Full Code Here

TOP

Related Classes of java.io.ObjectOutputStream.PutField

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.