Package com.landawn.abacus.util
Class ByteArrayOutputStream
java.lang.Object
java.io.OutputStream
com.landawn.abacus.util.ByteArrayOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
- Since:
- 0.8
- Author:
- Haiyang Li
-
Constructor Summary
-
Method Summary
Methods inherited from class java.io.OutputStream
flush, nullOutputStream, write
-
Constructor Details
-
ByteArrayOutputStream
public ByteArrayOutputStream() -
ByteArrayOutputStream
public ByteArrayOutputStream(int size) - Parameters:
size
-
-
-
Method Details
-
write
public void write(int b) - Specified by:
write
in classOutputStream
- Parameters:
b
-
-
write
public void write(byte[] b, int off, int len) - Overrides:
write
in classOutputStream
- Parameters:
b
-off
-len
-
-
write
public void write(byte b) - Parameters:
b
-
-
writeTo
- Parameters:
out
-- Throws:
IOException
- Signals that an I/O exception has occurred.
-
capacity
public int capacity()- Returns:
-
array
public byte[] array()- Returns:
-
size
public int size()- Returns:
-
reset
public void reset()Reset. -
toByteArray
public byte[] toByteArray()To byte array.- Returns:
-
toString
-
toString
- Parameters:
charset
-- Returns:
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
- Signals that an I/O exception has occurred.
-