Package com.google.protobuf
Class ByteString.Output
java.lang.Object
java.io.OutputStream
com.google.protobuf.ByteString.Output
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
- Enclosing class:
- ByteString
-
Method Summary
Modifier and TypeMethodDescriptionvoid
reset()
Resets this stream, so that all currently accumulated output in the output stream is discarded.int
size()
Returns the current size of the output stream.Creates a byte string.toString()
void
write
(byte[] b, int offset, int length) void
write
(int b) void
writeTo
(OutputStream out) Writes the complete contents of this byte array output stream to the specified output stream argument.Methods inherited from class java.io.OutputStream
close, flush, nullOutputStream, write
-
Method Details
-
write
public void write(int b) - Specified by:
write
in classOutputStream
-
write
public void write(byte[] b, int offset, int length) - Overrides:
write
in classOutputStream
-
toByteString
Creates a byte string. Its size is the current size of this output stream and its output has been copied to it.- Returns:
- the current contents of this output stream, as a byte string.
-
writeTo
Writes the complete contents of this byte array output stream to the specified output stream argument.- Parameters:
out
- the output stream to which to write the data.- Throws:
IOException
- if an I/O error occurs.
-
size
public int size()Returns the current size of the output stream.- Returns:
- the current size of the output stream
-
reset
public 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. -
toString
-