Package org.jboss.serial.objectmetamodel

Examples of org.jboss.serial.objectmetamodel.DataContainer


   {
   }

   public LocalMarshalledValue(Object obj) throws IOException
   {
      container = new DataContainer(false);
      ObjectOutput output = container.getOutput();
      output.writeObject(obj);
      output.flush();
      container.flush();
   }
View Full Code Here


      container.flush();
   }

   public LocalMarshalledValue(Object obj, SafeCloningRepository safeToReuse) throws IOException
   {
      container = new DataContainer(null, null, safeToReuse, false);
      ObjectOutput output = container.getOutput();
      output.writeObject(obj);
      output.flush();
      container.flush();
   }
View Full Code Here

      log.warn("LocalmarshalledValue readExternal is deprecated. This version is best used on call-by-value operations");
      byte[] bytes = new byte[in.readInt()];
      in.readFully(bytes);
      ByteArrayInputStream byteInput = new ByteArrayInputStream(bytes);
      DataInputStream input = new DataInputStream(byteInput);
      container = new DataContainer(false);
      container.loadData(input);
   }
View Full Code Here

   {
   }

   public LocalMarshalledValue(Object obj) throws IOException
   {
      container = new DataContainer(false);
      ObjectOutput output = container.getOutput();
      output.writeObject(obj);
      output.flush();
      container.flush();
   }
View Full Code Here

      container.flush();
   }

   public LocalMarshalledValue(Object obj, SafeCloningRepository safeToReuse) throws IOException
   {
      container = new DataContainer(null, null, safeToReuse, false);
      ObjectOutput output = container.getOutput();
      output.writeObject(obj);
      output.flush();
      container.flush();
   }
View Full Code Here

      log.warn("LocalmarshalledValue readExternal is deprecated. This version is best used on call-by-value operations");
      byte[] bytes = new byte[in.readInt()];
      in.readFully(bytes);
      ByteArrayInputStream byteInput = new ByteArrayInputStream(bytes);
      DataInputStream input = new DataInputStream(byteInput);
      container = new DataContainer(false);
      container.loadData(input);
   }
View Full Code Here

            dataOutput = new DataOutputStream(output);
        }
    }

    public void writeObjectUsingDataContainer(Object obj) throws IOException {
        DataContainer dataContainer = new DataContainer(null,this.getSubstitutionInterface(),checkSerializableClass,buffer,classDescriptorStrategy,objectDescriptorStrategy);
        if (output instanceof DataOutputStream)
        {
            dataOutput = (DataOutputStream) output;
        }
        else
        {
            dataOutput = new DataOutputStream(output);
        }

        ObjectOutput objectOutput = dataContainer.getOutput();
        objectOutput.writeObject(obj);

        //objectOutput.flush();
        dataContainer.saveData(dataOutput);

        //this.flush();
    }
View Full Code Here

        //this.flush();
    }

    protected void writeObjectOverride(Object obj) throws IOException {
        DataContainer dataContainer = new DataContainer(null,this.getSubstitutionInterface(),checkSerializableClass,buffer,classDescriptorStrategy,objectDescriptorStrategy);
        if (output instanceof DataOutputStream)
        {
            dataOutput = (DataOutputStream) output;
        }
        else
        {
            dataOutput = new DataOutputStream(output);
        }
       
        dataContainer.setStringBuffer(buffer);

        ObjectOutput objectOutput = dataContainer.getDirectOutput(this.dataOutput);
        objectOutput.writeObject(obj);

        //objectOutput.flush();
        //dataContainer.saveData(dataOutput);
View Full Code Here

    /** Reuses every primitive value to recreate another object.
     *  and if safeToReuse!=null, it can reuse the entire object */
    public Object smartClone(Object obj, SafeCloningRepository safeToReuse, ClassLoader loader) throws IOException
    {

        DataContainer container = new DataContainer(loader,this.getSubstitutionInterface(),safeToReuse,checkSerializableClass,buffer);
        ObjectOutput output = container.getOutput();
        output.writeObject(obj);
        output.flush();

        ObjectInput input = container.getInput();
        try
        {
            return input.readObject();
        }
        catch (ClassNotFoundException e)
View Full Code Here

  /** This is the old method of reading objects, always loading everything to a datacontainer*/
    public Object readObjectUsingDataContainer() throws IOException,
            ClassNotFoundException
    {
        DataContainer container = new DataContainer(classLoader,false,buffer);
        container.setClassResolver(resolver);
        container.loadData(dis);
        ObjectInput input = container.getInput();
        return input.readObject();
    }
View Full Code Here

TOP

Related Classes of org.jboss.serial.objectmetamodel.DataContainer

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.