Package com.mastfrog.util.streams
Class ContinuousStringStream
java.lang.Object
com.mastfrog.util.streams.ContinuousStringStream
- All Implemented Interfaces:
AutoCloseable
An InputStream-like construct which does not acknowledge the end of files.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintvoidclose()decode(CharBuffer target, CharsetDecoder charsetDecoder) Decode whatever characters are available into the passed CharBuffer.booleanisOpen()longposition()Get the postion the next read will come fromvoidposition(long pos) Change the positionlongskip(long l)
-
Constructor Details
-
ContinuousStringStream
-
-
Method Details
-
isOpen
public boolean isOpen() -
position
Get the postion the next read will come from- Returns:
- The position in the file
- Throws:
IOException
-
position
Change the position- Parameters:
pos-- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-
available
- Throws:
IOException
-
skip
- Throws:
IOException
-
decode
Decode whatever characters are available into the passed CharBuffer. Note that for multi-byte encodings, CharsetDecoders are stateful, and a previous call could result in being at a byte-position that's part-way through reading a character. Always pass the same decoder unless a decoding error has occurred.- Parameters:
target- The charbuffer to decode results intocharsetDecoder- A decoder for the desired charset- Returns:
- The result of decoding
- Throws:
IOException- If something goes wrong
-