com.github.shyiko.mysql.binlog.io
Class ByteArrayOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by com.github.shyiko.mysql.binlog.io.ByteArrayOutputStream
All Implemented Interfaces:
Closeable, Flushable

public class ByteArrayOutputStream
extends OutputStream

Author:
Stanley Shyiko

Constructor Summary
ByteArrayOutputStream()
           
ByteArrayOutputStream(OutputStream outputStream)
           
 
Method Summary
 void close()
           
 void flush()
           
 byte[] toByteArray()
           
 void write(int b)
           
 void writeInteger(int value, int length)
          Write int in little-endian format.
 void writeLong(long value, int length)
          Write long in little-endian format.
 void writeString(String value)
           
 void writeZeroTerminatedString(String value)
           
 
Methods inherited from class java.io.OutputStream
write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteArrayOutputStream

public ByteArrayOutputStream()

ByteArrayOutputStream

public ByteArrayOutputStream(OutputStream outputStream)
Method Detail

writeInteger

public void writeInteger(int value,
                         int length)
                  throws IOException
Write int in little-endian format.

Throws:
IOException

writeLong

public void writeLong(long value,
                      int length)
               throws IOException
Write long in little-endian format.

Throws:
IOException

writeString

public void writeString(String value)
                 throws IOException
Throws:
IOException

writeZeroTerminatedString

public void writeZeroTerminatedString(String value)
                               throws IOException
Throws:
IOException
See Also:
ByteArrayInputStream.readZeroTerminatedString()

write

public void write(int b)
           throws IOException
Specified by:
write in class OutputStream
Throws:
IOException

toByteArray

public byte[] toByteArray()

flush

public void flush()
           throws IOException
Specified by:
flush in interface Flushable
Overrides:
flush in class OutputStream
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class OutputStream
Throws:
IOException


Copyright © 2016. All Rights Reserved.