Most clients will use output streams that write data to the file system
FileOutputStream), the network (
URLConnection.getOutputStream()), or to an in-memory byte array
OutputStreamWriter to adapt a byte stream like this one into a
Most clients should wrap their output stream with
BufferedOutputStream. Callers that do only bulk writes may omit buffering.
FilterOutputStream, which delegates all calls to the target output stream.
All output stream subclasses should override both
three argument overload is necessary for bulk access to the data. This is
much more efficient than byte-by-byte access.
|Constructor and Description|
|Modifier and Type||Method and Description|
Closes this stream.
Flushes this stream.
Writes a single byte to this stream.
public void close() throws IOException
public void flush() throws IOException
public void write(byte buffer) throws IOException
write(buffer, 0, buffer.length).
public void write(byte buffer, int offset, int count) throws IOException
countbytes from the byte array
bufferstarting at position
offsetto this stream.
buffer- the buffer to be written.
offset- the start position in
bufferfrom where to get bytes.
count- the number of bytes from
bufferto write to this stream.
IOException- if an error occurs while writing to this stream.
offset < 0or
count < 0, or if
offset + countis bigger than the length of