Package java.io

Examples of java.io.ObjectOutputStream.reset()


        format.add("BOOLEAN");
       
        header.add(format);
        objOut.writeObject(header);
       
        objOut.reset();
        objOut.flush();

        list = new ArrayList<Object>();
        list.add(111);
        list.add("Test1");
View Full Code Here


        oos.writeObject(event);
        oos.flush();
      // Failing to reset the object output stream every now and
      // then creates a serious memory leak.
      // right now we always reset. TODO - set up frequency counter per oos?
      oos.reset();
      }
      catch(IOException e) {
        if (e instanceof InterruptedIOException) {
            Thread.currentThread().interrupt();
        }
View Full Code Here

                return o;
        }
       
        ByteArrayOutputStream bout = new ByteArrayOutputStream();
        ObjectOutputStream out = new ObjectOutputStream(bout);
        out.reset();
        out.writeUnshared(value);
        out.flush();
        return bout.toByteArray();
    }
View Full Code Here

            Socket s = new Socket("localhost", 34912);
            s.setTcpNoDelay(true);
            ObjectOutputStream output = new ObjectOutputStream(s.getOutputStream());
            //output.writeObject(new GstNotificationFileOpen(f.getAbsolutePath()));
            output.flush();
            output.reset();
            output.close();
            // If we were able to send the notification, just quit
            System.exit(0);
        }catch(Exception e){
            // ignore and start a new session
View Full Code Here

    bout.reset();
    oout.writeObject(p1);
    oout.flush();
    byte[] b1 = bout.toByteArray();
   
    oout.reset();
    bout.reset();
    oout.writeObject(p2);
    oout.flush();
    byte[] b2 = bout.toByteArray();
   
View Full Code Here

    ObjectOutputStream objOut = new ObjectOutputStream(byteOut);

    TestCircularReferences circular = TestCircularReferences.createTestInstance();
    objOut.writeObject(circular.getReferences());
    objOut.writeObject(circular);
    objOut.reset();
    objOut.writeObject(circular.getReferences());
   
    ObjectInputStream objInput = new ObjectInputStream(new ByteArrayInputStream(byteOut.toByteArray()));
   
    Object first = objInput.readObject();
View Full Code Here

    ObjectOutputStream objOut = new JBossObjectOutputStreamSharedTree(byteOut);

    TestCircularReferences circular = TestCircularReferences.createTestInstance();
    objOut.writeObject(circular.getReferences());
    objOut.writeObject(circular);
    objOut.reset();
    objOut.writeObject(circular.getReferences());
   
    ObjectInputStream objInput = new JBossObjectInputStreamSharedTree(new ByteArrayInputStream(byteOut.toByteArray()));
   
    Object first = objInput.readObject();
View Full Code Here

          oos.flush();
          if (++counter >= CoreConstants.OOS_RESET_FREQUENCY) {
            // failing to reset the stream periodically will result in a
            // serious memory leak (as noted in SocketAppenderBase)
            counter = 0;
            oos.reset();
          }
        }
        catch (InterruptedException ex) {
          Thread.currentThread().interrupt();
        }
View Full Code Here

      }

      ObjectOutputStream out = (ObjectOutputStream) getOutputStream();
      out.writeByte(ACK);
      out.flush();
      out.reset();
   }
}
View Full Code Here

    public void marshal(Object command, DataOutput ds) throws IOException {
        ObjectOutputStream out = new ObjectOutputStream((OutputStream)ds);
        out.writeObject(command);
        out.flush();
        out.reset();
    }

    public Object unmarshal(DataInput ds) throws IOException {
        try {
            ClassLoadingAwareObjectInputStream in = new ClassLoadingAwareObjectInputStream((InputStream)ds);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.