DthingApi
|
Public Member Functions | |
OutputStream () | |
void | close () throws IOException |
void | flush () throws IOException |
void | write (byte[] buffer) throws IOException |
void | write (byte[] buffer, int offset, int count) throws IOException |
abstract void | write (int oneByte) throws IOException |
A writable sink for bytes.
Most clients will use output streams that write data to the file system (FileOutputStream), the network (java.net.Socket#getOutputStream()/java.net.HttpURLConnection#getOutputStream()), or to an in-memory byte array (ByteArrayOutputStream).
Use OutputStreamWriter to adapt a byte stream like this one into a character stream.
Most clients should wrap their output stream with BufferedOutputStream. Callers that do only bulk writes may omit buffering.
Subclasses that decorate another output stream should consider subclassing FilterOutputStream, which delegates all calls to the target output stream.
All output stream subclasses should override both write(int) and write(byte[],int,int). The three argument overload is necessary for bulk access to the data. This is much more efficient than byte-by-byte access.
|
inline |
Default constructor.
|
inline |
Closes this stream. Implementations of this method should free any resources used by the stream. This implementation does nothing.
IOException | if an error occurs while closing this stream. |
|
inline |
Flushes this stream. Implementations of this method should ensure that any buffered data is written out. This implementation does nothing.
IOException | if an error occurs while flushing this stream. |
|
inline |
|
inline |
Writes
bytes from the byte array
starting at position
to this stream.
buffer | the buffer to be written. |
offset | the start position in buffer |
count | the number of bytes from buffer |
IOException | if an error occurs while writing to this stream. |
IndexOutOfBoundsException | if offset < 0 count < 0 offset + count buffer |
|
abstract |
Writes a single byte to this stream. Only the least significant byte of the integer
is written to the stream.
oneByte | the byte to be written. |
IOException | if an error occurs while writing to this stream. |