Package java.io

Examples of java.io.ObjectOutput


                if (useJRunit) ThreadLocalBenchmark.openBench(myTest.getClass().getName(),metaData);
                original = System.currentTimeMillis();
            }
            DataContainer container = new DataContainer(false,buffer);
            ObjectOutput out = container.getOutput();
            out.writeObject(myTest);
            container.flush();

            ObjectInput input = container.getInput();

            Object value = input.readObject();
View Full Code Here


   @Override
   public void generateState(String cacheName, OutputStream o) throws StateTransferException {
      StateTransferManager manager = getStateTransferManager(cacheName);
      if (manager == null) {
         ObjectOutput oo = null;
         try {
            oo = marshaller.startObjectOutput(o, false);
            // Not started yet, so send started flag false
            marshaller.objectToObjectStream(false, oo);
         } catch (Exception e) {
View Full Code Here

    }

    public void testClientCall() throws Exception
    {

       ObjectOutput output = new JBossObjectOutputStream(socket.getOutputStream());
       ObjectInput input = new JBossObjectInputStream((socket.getInputStream()));

       TestProxy proxy = TestProxy.createTestInstance();
       output.writeObject(proxy);
       output.flush();

       Integer obj = (Integer)input.readObject();

       System.out.println("response: " + obj);
View Full Code Here

    public void testSubstitution() throws Exception
    {

        Level1 level1 = new Level1();
        DataContainer container = new DataContainer(this.getClass().getClassLoader(),new Substitution(),false,null);
        ObjectOutput output =container.getOutput();
        output.writeObject(level1);
        output.flush();

        Level1 newLevel1 = (Level1)container.getInput().readObject();

        assertEquals("modified",newLevel1.getValue());
        assertEquals("modified",newLevel1.getLevel2().getValue());
View Full Code Here

  }

  public Reference getReference() throws NamingException {
    log.debug("Returning a Reference to the Ejb3Configuration");
    ByteArrayOutputStream stream = new ByteArrayOutputStream();
    ObjectOutput out = null;
    byte[] serialized;
    try {
      out = new ObjectOutputStream( stream );
      out.writeObject( this );
      out.close();
      serialized = stream.toByteArray();
      stream.close();
    }
    catch (IOException e) {
      NamingException namingException = new NamingException( "Unable to serialize Ejb3Configuration" );
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

   }

   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

        return new DroolsObjectInputStream(new ByteArrayInputStream(buf)).readObject();
    }

    private static byte[] serialize(Object obj) throws IOException {
        ByteArrayOutputStream   bytes   = new ByteArrayOutputStream();
        ObjectOutput            out = new DroolsObjectOutputStream(bytes);

        out.writeObject(obj);
        out.flush();
        out.close();

        return bytes.toByteArray();
    }
View Full Code Here

        return new ObjectInputStream(new ByteArrayInputStream(buf)).readObject();
    }

    private static byte[] marshal(Object obj) throws IOException {
        ByteArrayOutputStream   bytes   = new ByteArrayOutputStream();
        ObjectOutput            out = new ObjectOutputStream(bytes);

        out.writeObject(obj);
        out.flush();
        out.close();

        return bytes.toByteArray();
    }
View Full Code Here

      if (raw == null) {
         try {
            // Do NOT set instance to null over here, since it may be used elsewhere (e.g., in a cache listener).
            // this will be compacted by the MarshalledValueInterceptor when the call returns.
            ExposedByteArrayOutputStream baos = new ExposedByteArrayOutputStream(128);
            ObjectOutput out = marshaller.startObjectOutput(baos, true);
            try {
               marshaller.objectToObjectStream(instance, out);
            } finally {
               marshaller.finishObjectOutput(out);
            }
View Full Code Here

TOP

Related Classes of java.io.ObjectOutput

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.