Package org.shoal.ha.cache.impl.util
Class ReplicationOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.ByteArrayOutputStream
-
- org.shoal.ha.cache.impl.util.ReplicationOutputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
public class ReplicationOutputStream extends java.io.ByteArrayOutputStream- Author:
- Mahesh Kannan
-
-
Constructor Summary
Constructors Constructor Description ReplicationOutputStream()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbackToAppendMode()Note: This must be used only after a call to moveTointmark()intmoveTo(int pos)voidreWrite(int mark, byte[] data)byte[]toByteArray()voidwriteBoolean(boolean b)voidwriteInt(int value)voidwriteLengthPrefixedBytes(byte[] data)voidwriteLengthPrefixedString(java.lang.String str)voidwriteLong(long value)
-
-
-
Method Detail
-
mark
public int mark()
-
reWrite
public void reWrite(int mark, byte[] data)
-
writeInt
public void writeInt(int value) throws java.io.IOException- Throws:
java.io.IOException
-
writeLong
public void writeLong(long value) throws java.io.IOException- Throws:
java.io.IOException
-
writeLengthPrefixedString
public void writeLengthPrefixedString(java.lang.String str) throws java.io.IOException- Throws:
java.io.IOException
-
writeLengthPrefixedBytes
public void writeLengthPrefixedBytes(byte[] data) throws java.io.IOException- Throws:
java.io.IOException
-
writeBoolean
public void writeBoolean(boolean b) throws java.io.IOException- Throws:
java.io.IOException
-
moveTo
public int moveTo(int pos)
-
backToAppendMode
public void backToAppendMode()
Note: This must be used only after a call to moveTo
-
toByteArray
public byte[] toByteArray()
- Overrides:
toByteArrayin classjava.io.ByteArrayOutputStream
-
-