org.shoal.ha.cache.impl.util
Class ReplicationOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.ByteArrayOutputStream
          extended by org.shoal.ha.cache.impl.util.ReplicationOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

public class ReplicationOutputStream
extends java.io.ByteArrayOutputStream

Author:
Mahesh Kannan

Field Summary
 
Fields inherited from class java.io.ByteArrayOutputStream
buf, count
 
Constructor Summary
ReplicationOutputStream()
           
 
Method Summary
 void backToAppendMode()
          Note: This must be used only after a call to moveTo
 int mark()
           
 int moveTo(int pos)
           
 void reWrite(int mark, byte[] data)
           
 byte[] toByteArray()
           
 void writeBoolean(boolean b)
           
 void writeInt(int value)
           
 void writeLengthPrefixedBytes(byte[] data)
           
 void writeLengthPrefixedString(java.lang.String str)
           
 void writeLong(long value)
           
 
Methods inherited from class java.io.ByteArrayOutputStream
close, reset, size, toString, toString, toString, write, write, writeTo
 
Methods inherited from class java.io.OutputStream
flush, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ReplicationOutputStream

public ReplicationOutputStream()
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:
toByteArray in class java.io.ByteArrayOutputStream


Copyright © 2010. All Rights Reserved.