public class CharSequenceInputStream extends InputStream
InputStream implementation that can read from String, StringBuffer,
StringBuilder or CharBuffer.
| Constructor and Description |
|---|
CharSequenceInputStream(CharSequence cs,
Charset charset)
Constructor, calls
CharSequenceInputStream(CharSequence, Charset, int)
with a buffer size of 2048. |
CharSequenceInputStream(CharSequence cs,
Charset charset,
int bufferSize)
Constructor.
|
CharSequenceInputStream(CharSequence cs,
String charset)
Constructor, calls
CharSequenceInputStream(CharSequence, String, int)
with a buffer size of 2048. |
CharSequenceInputStream(CharSequence cs,
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() |
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 CharSequenceInputStream(CharSequence cs, Charset charset, int bufferSize)
cs - the input character sequencecharset - the character set name to usebufferSize - the buffer size to use.IllegalArgumentException - if the buffer is not large enough to hold a complete characterpublic CharSequenceInputStream(CharSequence cs, String charset, int bufferSize)
CharSequenceInputStream(CharSequence, Charset, int).cs - the input character sequencecharset - the character set name to usebufferSize - the buffer size to use.IllegalArgumentException - if the buffer is not large enough to hold a complete characterpublic CharSequenceInputStream(CharSequence cs, Charset charset)
CharSequenceInputStream(CharSequence, Charset, int)
with a buffer size of 2048.cs - the input character sequencecharset - the character set name to useIllegalArgumentException - if the buffer is not large enough to hold a complete characterpublic CharSequenceInputStream(CharSequence cs, String charset)
CharSequenceInputStream(CharSequence, String, int)
with a buffer size of 2048.cs - the input character sequencecharset - the character set name to useIllegalArgumentException - if the buffer is not large enough to hold a complete characterpublic int read(byte[] array,
int off,
int len)
throws IOException
read in class InputStreamIOExceptionpublic int read()
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] b)
throws IOException
read in class InputStreamIOExceptionpublic long skip(long n)
throws IOException
skip in class InputStreamIOExceptionpublic 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 void reset()
throws IOException
reset in class InputStreamIOExceptionpublic boolean markSupported()
markSupported in class InputStreamCopyright © 2002–2021 The Apache Software Foundation. All rights reserved.