public abstract static class ByteChannel.BufferOutputStream extends OutputStream
| Constructor and Description |
|---|
ByteChannel.BufferOutputStream() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
close() |
abstract void |
flush() |
abstract int |
write(InputStream in)
Writes some bytes into the output stream by reading them from the specified input stream.
|
long |
writeAll(InputStream in)
Writes all the returned bytes into the output stream by reading them from the specified
input stream.
Calling this method has the same effect as calling: |
write, write, writepublic abstract int write(@NotNull
InputStream in)
throws IOException
in - the input stream.-1 if there is
no more data because the end of the stream has been reached.IOException - If the first byte cannot be read for any reason other than
end of file, or if the input stream has been closed, or if
some other I/O error occurs.public long writeAll(@NotNull
InputStream in)
throws IOException
while (outputStream.write(inputStream) > 0) {
// Keep looping
}
in - the input stream.IOException - If the first byte cannot be read for any reason other than
end of file, or if the input stream has been closed, or if
some other I/O error occurs.public abstract void flush()
flush in interface Flushableflush in class OutputStreampublic abstract void close()
close in interface Closeableclose in interface AutoCloseableclose in class OutputStream