public class CharSequenceInputStream extends java.io.InputStream
InputStream implementation that can read from String, StringBuffer,
StringBuilder or CharBuffer.
| Constructor | Description |
|---|---|
CharSequenceInputStream(java.lang.CharSequence cs,
java.lang.String charset) |
Constructor, calls
CharSequenceInputStream(CharSequence, String, int)
with a buffer size of 2048. |
CharSequenceInputStream(java.lang.CharSequence cs,
java.lang.String charset,
int bufferSize) |
Constructor, calls
CharSequenceInputStream(CharSequence, Charset, int). |
CharSequenceInputStream(java.lang.CharSequence cs,
java.nio.charset.Charset charset) |
Constructor, calls
CharSequenceInputStream(CharSequence, Charset, int)
with a buffer size of 2048. |
CharSequenceInputStream(java.lang.CharSequence cs,
java.nio.charset.Charset charset,
int bufferSize) |
Constructor.
|
| Modifier and Type | Method | 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[] b,
int off,
int len) |
|
void |
reset() |
|
long |
skip(long n) |
public CharSequenceInputStream(java.lang.CharSequence cs, java.nio.charset.Charset charset, int bufferSize)
cs - the input character sequencecharset - the character set name to usebufferSize - the buffer size to use.java.lang.IllegalArgumentException - if the buffer is not large enough to hold a complete characterpublic CharSequenceInputStream(java.lang.CharSequence cs, java.lang.String charset, int bufferSize)
CharSequenceInputStream(CharSequence, Charset, int).cs - the input character sequencecharset - the character set name to usebufferSize - the buffer size to use.java.lang.IllegalArgumentException - if the buffer is not large enough to hold a complete characterpublic CharSequenceInputStream(java.lang.CharSequence cs, java.nio.charset.Charset charset)
CharSequenceInputStream(CharSequence, Charset, int)
with a buffer size of 2048.cs - the input character sequencecharset - the character set name to usejava.lang.IllegalArgumentException - if the buffer is not large enough to hold a complete characterpublic CharSequenceInputStream(java.lang.CharSequence cs, java.lang.String charset)
CharSequenceInputStream(CharSequence, String, int)
with a buffer size of 2048.cs - the input character sequencecharset - the character set name to usejava.lang.IllegalArgumentException - if the buffer is not large enough to hold a complete characterpublic int read(byte[] b, int off, int len) throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic 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 long skip(long n) throws java.io.IOException
skip in class java.io.InputStreamjava.io.IOExceptionpublic 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 class java.io.InputStreamjava.io.IOExceptionpublic void mark(int readlimit)
mark in class java.io.InputStreamreadlimit - max read limit (ignored)public void reset() throws java.io.IOException
reset in class java.io.InputStreamjava.io.IOExceptionpublic boolean markSupported()
markSupported in class java.io.InputStream