Modifier and Type | Field and Description |
---|---|
private java.nio.ByteBuffer |
bbuf |
private static int |
BUFFER_SIZE |
private java.nio.CharBuffer |
cbuf |
private java.nio.charset.CharsetEncoder |
encoder |
private int |
mark_bbuf |
private int |
mark_cbuf |
private static int |
NO_MARK |
Constructor and Description |
---|
CharSequenceInputStream(java.lang.CharSequence cs,
java.nio.charset.Charset charset)
Constructor, calls
CharSequenceInputStream(CharSequence, Charset, int)
with a buffer size of 2048. |
CharSequenceInputStream(java.lang.CharSequence cs,
java.nio.charset.Charset charset,
int bufferSize)
Constructor.
|
CharSequenceInputStream(java.lang.CharSequence cs,
java.lang.String charset)
Constructor, calls
CharSequenceInputStream(CharSequence, String, int)
with a buffer size of 2048. |
CharSequenceInputStream(java.lang.CharSequence cs,
java.lang.String charset,
int bufferSize)
Constructor, calls
CharSequenceInputStream(CharSequence, Charset, int) . |
Modifier and Type | Method and Description |
---|---|
int |
available()
Return an estimate of the number of bytes remaining in the byte stream.
|
void |
close() |
private void |
fillBuffer()
Fills the byte output buffer from the input char buffer.
|
void |
mark(int readlimit) |
boolean |
markSupported() |
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
void |
reset() |
long |
skip(long n) |
private static final int BUFFER_SIZE
private static final int NO_MARK
private final java.nio.charset.CharsetEncoder encoder
private final java.nio.CharBuffer cbuf
private final java.nio.ByteBuffer bbuf
private int mark_cbuf
private int mark_bbuf
public CharSequenceInputStream(java.lang.CharSequence cs, java.nio.charset.Charset charset, int bufferSize)
cs
- the input character sequencecharset
- the character set name to usebufferSize
- the buffer size to use.java.lang.IllegalArgumentException
- if the buffer is not large enough to hold a complete characterpublic CharSequenceInputStream(java.lang.CharSequence cs, java.lang.String charset, int bufferSize)
CharSequenceInputStream(CharSequence, Charset, int)
.cs
- the input character sequencecharset
- the character set name to usebufferSize
- the buffer size to use.java.lang.IllegalArgumentException
- if the buffer is not large enough to hold a complete characterpublic CharSequenceInputStream(java.lang.CharSequence cs, java.nio.charset.Charset charset)
CharSequenceInputStream(CharSequence, Charset, int)
with a buffer size of 2048.cs
- the input character sequencecharset
- the character set name to usejava.lang.IllegalArgumentException
- if the buffer is not large enough to hold a complete characterpublic CharSequenceInputStream(java.lang.CharSequence cs, java.lang.String charset)
CharSequenceInputStream(CharSequence, String, int)
with a buffer size of 2048.cs
- the input character sequencecharset
- the character set name to usejava.lang.IllegalArgumentException
- if the buffer is not large enough to hold a complete characterprivate void fillBuffer() throws java.nio.charset.CharacterCodingException
java.nio.charset.CharacterCodingException
- an error encoding datapublic int read(byte[] b, int off, int len) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public int read(byte[] b) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public long skip(long n) throws java.io.IOException
skip
in class java.io.InputStream
java.io.IOException
public int available() throws java.io.IOException
available
in class java.io.InputStream
java.io.IOException
- if an error occurs (probably not possible)public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.InputStream
java.io.IOException
public void mark(int readlimit)
mark
in class java.io.InputStream
readlimit
- max read limit (ignored)public void reset() throws java.io.IOException
reset
in class java.io.InputStream
java.io.IOException
public boolean markSupported()
markSupported
in class java.io.InputStream