StringReader
类。
@Deprecated public class StringBufferInputStream extends InputStream
ByteArrayInputStream
读取的字节数。
这个类使用的只有低八位的字符串中的每个字符的字符串。
ByteArrayInputStream
,
StringReader
Modifier and Type | Field and Description |
---|---|
protected String |
buffer
过时的。
读取字节的字符串。
|
protected int |
count
过时的。
输入流缓冲区中的有效字符数。
|
protected int |
pos
过时的。
从输入流缓冲区读取的下一个字符的索引。
|
Constructor and Description |
---|
StringBufferInputStream(String s)
过时的。
创建一个字符串输入流,从指定的字符串读取数据。
|
Modifier and Type | Method and Description |
---|---|
int |
available()
过时的。
返回可以从输入流中读取的字节数,而不阻塞。
|
int |
read()
过时的。
从这个输入流读取下一个数据字节。
|
int |
read(byte[] b, int off, int len)
过时的。
读到
len 字节从输入流到字节数组数据。
|
void |
reset()
过时的。
复位输入流读取这个输入流的数据缓冲区中的第一个字符开始。
|
long |
skip(long n)
过时的。
跳过
n 字节的输入从输入流。
|
close, mark, markSupported, read
protected String buffer
protected int pos
buffer
protected int count
buffer
public StringBufferInputStream(String s)
s
-潜在的输入缓冲器。
public int read()
0
一
int
到
255
返回。如果没有可用的字节,因为已到达流的末尾,则返回值
-1
。
对StringBufferInputStream
不能阻止read
方法。它返回这个输入流的缓冲区中的下一个字符的低八位。
read
方法重写,继承类
InputStream
-1
如果到达流的末尾。
public int read(byte[] b, int off, int len)
len
从输入流到字节数组数据字节。
对StringBufferInputStream
不能阻止read
方法。它将该输入流中的字符的低八位复制到字节数组参数中。
read
方法重写,继承类
InputStream
b
-缓冲区中读取数据。
off
的起始偏移量的数据。
len
-的最大字节数读。
-1
如果没有更多的数据,因为已到达流的末尾。
InputStream.read()
public long skip(long n)
n
字节的输入从输入流。如果达到输入流的结尾,则可能会跳过更少的字节数。
skip
方法重写,继承类
InputStream
n
-字节数被跳过。
public int available()
available
方法重写,继承类
InputStream
count - pos
的价值,这是有待从输入缓冲区读取的字节数。
public void reset()
reset
方法重写,继承类
InputStream
InputStream.mark(int)
,
IOException
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.