Package org.fusesource.hawtbuf

Examples of org.fusesource.hawtbuf.DataByteArrayOutputStream.reset()


            DataByteArrayOutputStream buffer = new DataByteArrayOutputStream(size);
            boolean forceToDisk = false;
            WriteCommand latest = null;

            // Write an empty batch control record.
            buffer.reset();
            buffer.writeInt(BATCH_CONTROL_RECORD_SIZE);
            buffer.writeByte(Location.BATCH_CONTROL_RECORD_TYPE);
            buffer.writeInt(0);
            buffer.write(BATCH_CONTROL_RECORD_MAGIC);
            buffer.writeLong(0);
View Full Code Here


                latest = current;
            }

            // Now we can fill in the batch control record properly.
            Buffer sequence = buffer.toBuffer();
            buffer.reset();
            buffer.skip(Journal.HEADER_SIZE);
            buffer.writeInt(sequence.getLength() - Journal.HEADER_SIZE - Journal.BATCH_SIZE);
            buffer.skip(Journal.BATCH_CONTROL_RECORD_MAGIC.length);
            if (checksum) {
                Checksum adler32 = new Adler32();
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.