Package java.io

Examples of java.io.ObjectOutputStream.reset()


                }
                DataOutputStream dataOut = new DataOutputStream(os);
                ObjectOutputStream objOut = new ObjectOutputStream(dataOut);
                objOut.writeObject(object);
                objOut.flush();
                objOut.reset();
                objOut.close();
                setContent(bytesOut.toByteSequence());
            } catch (IOException ioe) {
                throw new RuntimeException(ioe.getMessage(), ioe);
            }
View Full Code Here


                }
                DataOutputStream dataOut = new DataOutputStream(os);
                ObjectOutputStream objOut = new ObjectOutputStream(dataOut);
                objOut.writeObject(object);
                objOut.flush();
                objOut.reset();
                objOut.close();
                setContent(bytesOut.toByteSequence());
            } catch (IOException ioe) {
                throw new RuntimeException(ioe.getMessage(), ioe);
            }
View Full Code Here

//        dataOut.write(data);
       
        ObjectOutputStream objectOut=new ObjectOutputStream((OutputStream) dataOut);
        objectOut.writeObject(object);
        objectOut.flush();
        objectOut.reset();
    }

    /**
     * Read the entry from the RawContainer
     *
 
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

        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) {
        // there was an io exception so just drop the connection
        oosList.removeElementAt(streamCount);
        getLogger().debug("dropped connection");
View Full Code Here

        ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(file));
        start = freeMem();
        for (int i=0; i<size; i++) {
            Page page = randomPage();
            page.write(out);
            out.reset();
        }
        end = freeMem();
        out.close();
        assertTrue("The serialization process has a memory leak", end > start * 0.9);

 
View Full Code Here

            }
            // if the page selected for output is different from the last one
            if (null != valold && valout.compareTo(valold) != 0) {
                // write that page to the output file
                pageold.write(out);
                out.reset();
            }
            pageold = pageout;
            valold = valout;
        }
        // the last page must be written
View Full Code Here

            valold = valout;
        }
        // the last page must be written
        if (null != pageold) {
            pageold.write(out);
            out.reset();
        }
        Execute.close(in1);
        Execute.close(in2);
        Execute.close(out);
    }
View Full Code Here

        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
        try {
            final ObjectOutputStream oos = new PrivateObjectOutputStream(baos);
            try {
                oos.writeObject(event);
                oos.reset();
            } finally {
                oos.close();
            }
        } catch (final IOException ioe) {
            LOGGER.error("Serialization of LogEvent failed.", ioe);
View Full Code Here

                }
                DataOutputStream dataOut = new DataOutputStream(os);
                ObjectOutputStream objOut = new ObjectOutputStream(dataOut);
                objOut.writeObject(object);
                objOut.flush();
                objOut.reset();
                objOut.close();
                setContent(bytesOut.toBuffer());
            } catch (IOException ioe) {
                throw new RuntimeException(ioe.getMessage(), ioe);
            }
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.