org.simpleframework.util.buffer
Interface Stream
- All Known Subinterfaces:
- Buffer
- All Known Implementing Classes:
- ArrayBuffer, BufferAllocator
public interface Stream
The Stream interface is used to represent anything that
can be streamed. Typically this is used to represent a region of
memory that can be read through an InputStream object.
Representing an object as a stream ensures it can each time the
input stream is acquired it reads from the start of the buffer.
- Author:
- Niall Gallagher
- See Also:
Buffer
getInputStream
InputStream getInputStream()
throws IOException
- This method is used so that a buffer can be represented as a
stream of bytes. This provides a quick means to access the data
that has been written to the buffer. It wraps the buffer within
an input stream so that it can be read directly.
- Returns:
- a stream that can be used to read the buffered bytes
- Throws:
IOException