Class ByteArrayOutputStream
java.lang.Object
java.io.OutputStream
com.github.shyiko.mysql.binlog.io.ByteArrayOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
- Author:
- Stanley Shyiko
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidflush()byte[]voidwrite(byte[] bytes) voidwrite(int b) voidwriteInteger(int value, int length) Write int in little-endian format.voidwriteLong(long value, int length) Write long in little-endian format.voidwriteString(String value) voidwriteZeroTerminatedString(String value) Methods inherited from class java.io.OutputStream
nullOutputStream, write
-
Constructor Details
-
ByteArrayOutputStream
public ByteArrayOutputStream() -
ByteArrayOutputStream
-
-
Method Details
-
writeInteger
Write int in little-endian format.- Parameters:
value- integer to writelength- length in bytes of the integer- Throws:
IOException- on underlying stream error
-
writeLong
Write long in little-endian format.- Parameters:
value- long to writelength- length in bytes of the long- Throws:
IOException- on underlying stream error
-
writeString
- Throws:
IOException
-
writeZeroTerminatedString
- Parameters:
value- string to write- Throws:
IOException- on underlying stream error- See Also:
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
toByteArray
public byte[] toByteArray() -
flush
- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-