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:
Closeable,Flushable,AutoCloseable
public class ReplicationOutputStream extends ByteArrayOutputStream
- Author:
- Mahesh Kannan
-
-
Field Summary
-
Fields inherited from class java.io.ByteArrayOutputStream
buf, count
-
-
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(String str)voidwriteLong(long value)-
Methods inherited from class java.io.ByteArrayOutputStream
close, reset, size, toString, toString, toString, toString, write, write, writeBytes, writeTo
-
Methods inherited from class java.io.OutputStream
flush, nullOutputStream, write
-
-
-
-
Method Detail
-
mark
public int mark()
-
reWrite
public void reWrite(int mark, byte[] data)
-
writeInt
public void writeInt(int value) throws IOException- Throws:
IOException
-
writeLong
public void writeLong(long value) throws IOException- Throws:
IOException
-
writeLengthPrefixedString
public void writeLengthPrefixedString(String str) throws IOException
- Throws:
IOException
-
writeLengthPrefixedBytes
public void writeLengthPrefixedBytes(byte[] data) throws IOException- Throws:
IOException
-
writeBoolean
public void writeBoolean(boolean b) throws IOException- Throws:
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 classByteArrayOutputStream
-
-