Package overit.geocall.util
Class ReaderInputStream
java.lang.Object
java.io.InputStream
overit.geocall.util.ReaderInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
An InputStream backed by a Reader
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected byte[]protected ByteArrayOutputStreamprotected char[]protected intprotected intprotected Readerprotected Writer -
Constructor Summary
ConstructorsConstructorDescriptionReaderInputStream(Reader _reader) Constructor to supply a ReaderReaderInputStream(Reader reader, String encoding) Constructor to supply a Reader and an encoding -
Method Summary
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Field Details
-
_reader
-
_byteArrayOut
-
_writer
-
_chars
protected char[] _chars -
_buffer
protected byte[] _buffer -
_index
protected int _index -
_length
protected int _length
-
-
Constructor Details
-
ReaderInputStream
Constructor to supply a Reader- Parameters:
_reader- - the Reader used by the InputStream
-
ReaderInputStream
Constructor to supply a Reader and an encoding- Parameters:
reader- - the Reader used by the InputStreamencoding- - the encoding to use for the InputStream- Throws:
UnsupportedEncodingException- if the encoding is not supported
-
-
Method Details
-
read
- Specified by:
readin classInputStream- Throws:
IOException- See Also:
-
fillBuffer
- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException- See Also:
-
available
- Overrides:
availablein classInputStream- Throws:
IOException- See Also:
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException- See Also:
-