public
static
final
class
ByteString
.
Output
extends
OutputStream
Outputs to a ByteString
instance. Call #toByteString()
to create the ByteString
instance.
Methods
reset()
public
synchronized
void
reset
()
Resets this stream, so that all currently accumulated output in the output stream is discarded. The output stream can be used again, reusing the already allocated buffer space.
size()
public
synchronized
int
size
()
Returns the current size of the output stream.
toByteString()
public
synchronized
ByteString
toByteString
()
Creates a byte string with the size and contents of this output stream. This does not create a new copy of the underlying bytes. If the stream size grows dynamically, the runtime is O(log n) in respect to the number of bytes written to the Output . If the stream size stays within the initial capacity, the runtime is O(1).
toString()
public
String
toString
()
write(byte[] b, int offset, int length)
public
synchronized
void
write
(
byte
[]
b
,
int
offset
,
int
length
)
write(int b)
public
synchronized
void
write
(
int
b
)
writeTo(OutputStream out)
public
void
writeTo
(
OutputStream
out
)
Writes the complete contents of this byte array output stream to the specified output stream argument.

