public class CharSequenceInputStream extends InputStream
InputStream to read from String, StringBuffer, StringBuilder or CharBuffer.
| Modifier and Type | Class and Description |
|---|---|
static class |
CharSequenceInputStream.Builder
Builds a new
CharSequenceInputStream instance. |
| Constructor and Description |
|---|
CharSequenceInputStream(CharSequence cs,
Charset charset)
Deprecated.
|
CharSequenceInputStream(CharSequence cs,
Charset charset,
int bufferSize)
Deprecated.
|
CharSequenceInputStream(CharSequence cs,
String charset)
Deprecated.
|
CharSequenceInputStream(CharSequence cs,
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() |
void |
mark(int readlimit) |
boolean |
markSupported() |
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] array,
int off,
int len) |
void |
reset() |
long |
skip(long n) |
@Deprecated public CharSequenceInputStream(CharSequence cs, 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.IllegalArgumentException - if the buffer is not large enough to hold a complete character.@Deprecated public CharSequenceInputStream(CharSequence cs, 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.IllegalArgumentException - if the buffer is not large enough to hold a complete character.@Deprecated public CharSequenceInputStream(CharSequence cs, 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.IllegalArgumentException - if the buffer is not large enough to hold a complete character.@Deprecated public CharSequenceInputStream(CharSequence cs, 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.IllegalArgumentException - if the buffer is not large enough to hold a complete character.public static CharSequenceInputStream.Builder builder()
CharSequenceInputStream.Builder.CharSequenceInputStream.Builder.public int available() throws IOException
available in class InputStreamIOException - if an error occurs (probably not possible).public void close() throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class InputStreamIOExceptionpublic void mark(int readlimit)
mark in class InputStreamreadlimit - max read limit (ignored).public boolean markSupported()
markSupported in class InputStreampublic int read() throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] b) throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] array, int off, int len) throws IOException
read in class InputStreamIOExceptionpublic void reset() throws IOException
reset in class InputStreamIOExceptionpublic long skip(long n) throws IOException
skip in class InputStreamIOExceptionCopyright © 2002–2023 The Apache Software Foundation. All rights reserved.