Package com.ibatis.common.io
Class ReaderInputStream
java.lang.Object
java.io.InputStream
com.ibatis.common.io.ReaderInputStream
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected byte[]The buffer.protected ByteArrayOutputStreamThe byte array out.protected char[]The chars.protected intThe length.protected intThe length.protected ReaderThe reader.protected WriterThe writer. -
Constructor Summary
ConstructorsConstructorDescriptionReaderInputStream(Reader reader) Constructor to supply a Reader.ReaderInputStream(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, transferTo
-
Field Details
-
reader
The reader. -
byteArrayOut
The byte array out. -
writer
The writer. -
chars
protected char[] charsThe chars. -
buffer
protected byte[] bufferThe buffer. -
index
protected int indexThe length. -
length
protected int lengthThe 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
Fill buffer.- Throws:
IOException- Signals that an I/O exception has occurred.
-
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:
-