Modifier and Type | Field and Description |
---|---|
private java.nio.ByteBuffer |
bbuf |
private java.nio.CharBuffer |
cbuf |
private java.nio.charset.CharsetEncoder |
encoder |
private int |
mark |
Constructor and Description |
---|
CharSequenceInputStream(java.lang.CharSequence s,
java.nio.charset.Charset charset)
Constructor, calls
CharSequenceInputStream(CharSequence, Charset, int)
with a buffer size of 2048. |
CharSequenceInputStream(java.lang.CharSequence s,
java.nio.charset.Charset charset,
int bufferSize)
Constructor.
|
CharSequenceInputStream(java.lang.CharSequence s,
java.lang.String charset)
Constructor, calls
CharSequenceInputStream(CharSequence, String, int)
with a buffer size of 2048. |
CharSequenceInputStream(java.lang.CharSequence s,
java.lang.String charset,
int bufferSize)
Constructor, calls
CharSequenceInputStream(CharSequence, Charset, int) . |
Modifier and Type | Method and Description |
---|---|
int |
available() |
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 final java.nio.charset.CharsetEncoder encoder
private final java.nio.CharBuffer cbuf
private final java.nio.ByteBuffer bbuf
private int mark
public CharSequenceInputStream(java.lang.CharSequence s, java.nio.charset.Charset charset, int bufferSize)
s
- the input character sequencecharset
- the character set name to usebufferSize
- the buffer size to use.public CharSequenceInputStream(java.lang.CharSequence s, java.lang.String charset, int bufferSize)
CharSequenceInputStream(CharSequence, Charset, int)
.s
- the input character sequencecharset
- the character set name to usebufferSize
- the buffer size to use.public CharSequenceInputStream(java.lang.CharSequence s, java.nio.charset.Charset charset)
CharSequenceInputStream(CharSequence, Charset, int)
with a buffer size of 2048.s
- the input character sequencecharset
- the character set name to usepublic CharSequenceInputStream(java.lang.CharSequence s, java.lang.String charset)
CharSequenceInputStream(CharSequence, String, int)
with a buffer size of 2048.s
- the input character sequencecharset
- the character set name to useprivate 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
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
Copyright (c) 2002-2015 Apache Software Foundation