A stream class base that implements most interface details. The subclasses need only implement the actual I/O operation.
This stream doesn't support marking.
Parent Class
Parent Interfaces
Type | Name | Signature |
---|---|---|
method | canMark | public bool canMark() |
method | close | public void close() |
method | flush | public void flush() |
method | mark | public void mark() |
method | read | public int read() |
method | read | public int read(byte[], int, int) |
method | reset | public void reset() |
method | skip | public int skip(int) |
method | write | public void write(byte) |
method | write | public void write(byte[], int, int) |
public bool canMark()
(INHERITED DOC)
Whether this stream supports position-manipulating operations. This method governs mark, reset.
Returns
public void close()
(INHERITED DOC)
Close the stream. Once the stream is closed it cannot be re-opened.
public void flush()
(INHERITED DOC)
Flush the stream. This will materialize all the data copy which may so far have only occurred inside in-memory data buffer, which is usually an implementation detail of the stream. It's best practice for the user to call this method between writing calls, as well as at the conclusion of data copy logic, to ensure all the data have effectively flown into the sink.
public void mark()
(INHERITED DOC)
Mark the current position of stream. Calling reset() will move the stream pointer to the marked position.
If canMark() return false, this method will throw IOException.
public int read()
(INHERITED DOC)
Read one byte from the stream.
This will move forward the stream pointer by one. If canRead() return false, this method will throw IOException.
Returns
public int read(byte[] buffer, int offset, int count)
(INHERITED DOC)
Try to read desired number of bytes from the stream into the given buffer, starting from the offset and not exceeding the buffer's capacity. This will move forward the stream pointer by the number of bytes actually read. If the stream hits the end, or the buffer runs short of room, before reading the specified count, only those bytes will be read, making the returned value less than the count argument.
This method moves forward the stream pointer by the count equal to returned value. If canRead() return false, this method will throw IOException.
Parameters
Returns
public void reset()
(INHERITED DOC)
Move the stream pointer to the position marked by mark().
If canMark() return false, this method will throw IOException.
public int skip(int count)
(INHERITED DOC)
Instead of reading, try to skip desired number of bytes from the stream. This will move forward the stream pointer by the number of bytes actually read. If the stream hits the end before reading the specified count, only those bytes will be skipped, making the returned value less than the count argument.
This method moves forward the stream pointer by the count equal to returned value. If canRead() return false, this method will throw IOException.
Parameters
Returns
public void write(byte data)
(INHERITED DOC)
Write one byte to the stream.
This will move forward the stream pointer by one. If canWrite() return false, this method will throw IOException.
Parameters
public void write(byte[] buffer, int offset, int count)
(INHERITED DOC)
Try to write desired number of bytes into the stream from the given buffer, starting from the offset and not exceeding the buffer's capacity. This will move forward the stream pointer by the number of bytes actually read. If the buffer hits the end before reading the specified count, only those bytes will be written, making the returned value less than the count argument.
This method moves forward the stream pointer by the count equal to returned value. If canWrite() return false, this method will throw IOException.
Parameters