|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.InputStream
ecologylab.generic.StringInputStream
public class StringInputStream
A mechanism for reading Strings from
java.io.InputStreams of various formats.
Used especially in drag and drop, for getting values.
| Field Summary | |
|---|---|
protected java.lang.CharSequence |
buffer
The string from which bytes are read. |
protected int |
count
The number of valid characters in the input stream buffer. |
protected int |
pos
The index of the next character to read from the input stream buffer. |
static int |
UTF16
|
static int |
UTF16_BE
|
static int |
UTF16_LE
|
static int |
UTF8
|
| Constructor Summary | |
|---|---|
StringInputStream(java.lang.CharSequence charSequence)
|
|
StringInputStream(java.lang.CharSequence charSequence,
int format)
Creates a string input stream to read data from the specified string. |
|
| Method Summary | |
|---|---|
int |
available()
|
int |
read()
Reads the next byte of data from this input stream. |
int |
read(byte[] buf,
int off,
int len)
|
| Methods inherited from class java.io.InputStream |
|---|
close, mark, markSupported, read, reset, skip |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int UTF16_LE
public static final int UTF16_BE
public static final int UTF16
public static final int UTF8
protected java.lang.CharSequence buffer
protected int pos
StringBufferInputStream.bufferprotected int count
StringBufferInputStream.buffer| Constructor Detail |
|---|
public StringInputStream(java.lang.CharSequence charSequence,
int format)
charSequence - the underlying input buffer.public StringInputStream(java.lang.CharSequence charSequence)
| Method Detail |
|---|
public int read()
int in the range
0 to 255. If no byte is available
because the end of the stream has been reached, the value
-1 is returned.
The read method of
StringBufferInputStream cannot block. It returns the
low eight bits of the next character in this input stream's buffer.
read in class java.io.InputStream-1 if the end of the
stream is reached.
public int read(byte[] buf,
int off,
int len)
read in class java.io.InputStream
public int available()
throws java.io.IOException
available in class java.io.InputStreamjava.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||