public class CharSequenceInputStream extends InputStream
InputStream to read bytes from String, StringBuffer, StringBuilder or CharBuffer,
encoded using the specified Charset. The Charset defaults to Charset.defaultCharset().
Note: Supports mark(int) and reset().
To build an instance, use CharSequenceInputStream.Builder.
CharSequenceInputStream.Builder| Modifier and Type | Class and Description |
|---|---|
static class |
CharSequenceInputStream.Builder
Builds a new
CharSequenceInputStream. |
| Modifier and Type | Method and Description |
|---|---|
int |
available()
Gets a lower bound on the number of bytes remaining in the byte stream.
|
static CharSequenceInputStream.Builder |
builder()
Constructs a new
CharSequenceInputStream.Builder. |
void |
close() |
(package private) CharsetEncoder |
getCharsetEncoder()
Gets the CharsetEncoder.
|
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) |
public int available()
throws IOException
available in class InputStreamIOException - if an error occurs (probably not possible).public static CharSequenceInputStream.Builder builder()
CharSequenceInputStream.Builder.CharSequenceInputStream.Builder.public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class InputStreamIOExceptionCharsetEncoder getCharsetEncoder()
public 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 InputStreamIOException