| Modifier and Type | Class and Description |
|---|---|
static class |
CharSequenceInputStream.Builder
Builds a new
CharSequenceInputStream instance. |
| Modifier and Type | Field and Description |
|---|---|
private java.nio.ByteBuffer |
bBuf |
private int |
bBufMark |
private java.nio.CharBuffer |
cBuf |
private int |
cBufMark |
private java.nio.charset.CharsetEncoder |
charsetEncoder |
private static int |
NO_MARK |
| Modifier | Constructor and Description |
|---|---|
|
CharSequenceInputStream(java.lang.CharSequence cs,
java.nio.charset.Charset charset)
Deprecated.
|
|
CharSequenceInputStream(java.lang.CharSequence cs,
java.nio.charset.Charset charset,
int bufferSize)
Deprecated.
|
private |
CharSequenceInputStream(java.lang.CharSequence cs,
int bufferSize,
java.nio.charset.CharsetEncoder charsetEncoder) |
|
CharSequenceInputStream(java.lang.CharSequence cs,
java.lang.String charset)
Deprecated.
|
|
CharSequenceInputStream(java.lang.CharSequence cs,
java.lang.String charset,
int bufferSize)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
int |
available()
Return an estimate of the number of bytes remaining in the byte stream.
|
static CharSequenceInputStream.Builder |
builder()
Constructs a new
CharSequenceInputStream.Builder. |
void |
close() |
private void |
fillBuffer()
Fills the byte output buffer from the input char buffer.
|
(package private) java.nio.charset.CharsetEncoder |
getCharsetEncoder()
Gets the CharsetEncoder.
|
void |
mark(int readLimit) |
boolean |
markSupported() |
private static java.nio.charset.CharsetEncoder |
newEncoder(java.nio.charset.Charset charset) |
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] array,
int off,
int len) |
void |
reset() |
long |
skip(long n) |
private static final int NO_MARK
private final java.nio.ByteBuffer bBuf
private int bBufMark
private final java.nio.CharBuffer cBuf
private int cBufMark
private final java.nio.charset.CharsetEncoder charsetEncoder
@Deprecated
public CharSequenceInputStream(java.lang.CharSequence cs,
java.nio.charset.Charset charset)
builder(), CharSequenceInputStream.Builder, and CharSequenceInputStream.Builder.get()IOUtils.DEFAULT_BUFFER_SIZE.cs - the input character sequence.charset - the character set name to use.java.lang.IllegalArgumentException - if the buffer is not large enough to hold a complete character.@Deprecated
public CharSequenceInputStream(java.lang.CharSequence cs,
java.nio.charset.Charset charset,
int bufferSize)
builder(), CharSequenceInputStream.Builder, and CharSequenceInputStream.Builder.get()cs - the input character sequence.charset - the character set name to use, null maps to the default Charset.bufferSize - the buffer size to use.java.lang.IllegalArgumentException - if the buffer is not large enough to hold a complete character.private CharSequenceInputStream(java.lang.CharSequence cs,
int bufferSize,
java.nio.charset.CharsetEncoder charsetEncoder)
@Deprecated
public CharSequenceInputStream(java.lang.CharSequence cs,
java.lang.String charset)
builder(), CharSequenceInputStream.Builder, and CharSequenceInputStream.Builder.get()IOUtils.DEFAULT_BUFFER_SIZE.cs - the input character sequence.charset - the character set name to use.java.lang.IllegalArgumentException - if the buffer is not large enough to hold a complete character.@Deprecated
public CharSequenceInputStream(java.lang.CharSequence cs,
java.lang.String charset,
int bufferSize)
builder(), CharSequenceInputStream.Builder, and CharSequenceInputStream.Builder.get()cs - the input character sequence.charset - the character set name to use, null maps to the default Charset.bufferSize - the buffer size to use.java.lang.IllegalArgumentException - if the buffer is not large enough to hold a complete character.public static CharSequenceInputStream.Builder builder()
CharSequenceInputStream.Builder.CharSequenceInputStream.Builder.private static java.nio.charset.CharsetEncoder newEncoder(java.nio.charset.Charset charset)
public int available()
throws java.io.IOException
available in class java.io.InputStreamjava.io.IOException - if an error occurs (probably not possible).public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.InputStreamjava.io.IOExceptionprivate void fillBuffer()
throws java.nio.charset.CharacterCodingException
java.nio.charset.CharacterCodingException - an error encoding data.java.nio.charset.CharsetEncoder getCharsetEncoder()
public void mark(int readLimit)
mark in class java.io.InputStreamreadLimit - max read limit (ignored).public boolean markSupported()
markSupported in class java.io.InputStreampublic int read()
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic int read(byte[] b)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic int read(byte[] array,
int off,
int len)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic void reset()
throws java.io.IOException
reset in class java.io.InputStreamjava.io.IOExceptionpublic long skip(long n)
throws java.io.IOException
skip in class java.io.InputStreamjava.io.IOException