jaulib v1.3.0
Jau Support Library (C++, Java, ..)
|
Abstract byte output stream object, to write data to a sink. More...
Public Member Functions | |
boolean | is_open () |
Checks if the stream has an associated file. More... | |
void | closeStream () |
Close the stream if supported by the underlying mechanism. More... | |
void | close () |
Close the stream if supported by the underlying mechanism and dispose the native instance. More... | |
int | write (byte in[], final int offset, final int length) |
Write to the data sink. More... | |
int | write (ByteBuffer in) |
Write to the data sink. More... | |
String | id () |
return the id of this data source More... | |
long | tellp () |
Returns the output position indicator. More... | |
String | toString () |
Public Member Functions inherited from org.jau.io.IOStateFunc | |
void | clear (final IOState state) |
Clears state flags by assignment to the given value. More... | |
IOState | rdState () |
Returns the current state flags. More... | |
void | setState (final IOState state) |
Sets state flags, by keeping its previous bits. More... | |
boolean | good () |
Checks if no error nor eof() has occurred i.e. More... | |
boolean | eof () |
Checks if end-of-file has been reached. More... | |
boolean | fail () |
Checks if an error has occurred. More... | |
boolean | bad () |
Checks if a non-recoverable error has occurred. More... | |
boolean | timeout () |
Checks if a timeout (non-recoverable) has occurred. More... | |
Abstract byte output stream object, to write data to a sink.
Its specializations utilize a native C++ implementation derived from jau::io::ByteOutStream
.
All method implementations are of noexcept
.
One may use fail() to detect whether an error has occurred.
Definition at line 39 of file ByteOutStream.java.
void org.jau.io.ByteOutStream.close | ( | ) |
Close the stream if supported by the underlying mechanism and dispose the native instance.
Instance is unusable after having this method called.
Implemented in org.jau.io.ByteOutStream_File.
void org.jau.io.ByteOutStream.closeStream | ( | ) |
Close the stream if supported by the underlying mechanism.
Native instance will not be disposed.
Implemented in org.jau.io.ByteOutStream_File.
String org.jau.io.ByteOutStream.id | ( | ) |
return the id of this data source
Implemented in org.jau.io.ByteOutStream_File.
boolean org.jau.io.ByteOutStream.is_open | ( | ) |
Checks if the stream has an associated file.
Implemented in org.jau.io.ByteOutStream_File.
long org.jau.io.ByteOutStream.tellp | ( | ) |
Returns the output position indicator.
Implemented in org.jau.io.ByteOutStream_File.
String org.jau.io.ByteOutStream.toString | ( | ) |
Implemented in org.jau.io.ByteOutStream_File.
int org.jau.io.ByteOutStream.write | ( | byte | in[], |
final int | offset, | ||
final int | length | ||
) |
Write to the data sink.
Moves the internal offset so that every call to write will be appended to the sink.
This method is not blocking beyond the transfer length bytes.
in | the input bytes to write out |
offset | offset to byte array to write out |
length | the length of the byte array in |
Implemented in org.jau.io.ByteOutStream_File.
int org.jau.io.ByteOutStream.write | ( | ByteBuffer | in | ) |
Write to the data sink.
Moves the internal offset so that every call to write will be appended to the sink.
This method is not blocking beyond the transfer length bytes.
in | the direct ByteBuffer source to be written to the sink from position up to its limit , i.e. remaining . Position will be set to position + written-bytes. |
position
- previous position
. Implemented in org.jau.io.ByteOutStream_File.