|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
java.lang.Objectjava.io.InputStream
java.io.StringBufferInputStream
StringReader 類別進行創建。
@Deprecated public class StringBufferInputStream
此類別允許應用程序創建輸入串流,在該串流中讀取的位元組由字元串內容提供。應用程序還可以使用 ByteArrayInputStream 從 byte 陣列中讀取位元組。
只有字元串中每個字元的低八位可以由此類別使用。
ByteArrayInputStream,
StringReader| 欄位摘要 | |
|---|---|
protected String |
buffer
已過時。 從中讀取位元組的字元串。 |
protected int |
count
已過時。 輸入串流緩衝區中有效字元數。 |
protected int |
pos
已過時。 要從輸入串流緩衝區中讀取的下一個字元的索引。 |
| 建構子摘要 | |
|---|---|
StringBufferInputStream(String s)
已過時。 創建一個字元串輸入串流,以從指定字元串讀取資料。 |
|
| 方法摘要 | |
|---|---|
int |
available()
已過時。 返回無阻塞情況下可以從此輸入串流讀取的位元組數。 |
int |
read()
已過時。 從此輸入串流中讀取下一個資料的位元組。 |
int |
read(byte[] b,
int off,
int len)
已過時。 將最多 len 個資料位元組從此輸入串流讀入 byte 陣列。 |
void |
reset()
已過時。 將輸入串流重置為開始讀取此輸入串流的基礎緩衝區的第一個字元處。 |
long |
skip(long n)
已過時。 從此輸入串流中跳過輸入的 n 個位元組。 |
| 從類別 java.io.InputStream 繼承的方法 |
|---|
close, mark, markSupported, read |
| 從類別 java.lang.Object 繼承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 欄位詳細資訊 |
|---|
protected String buffer
protected int pos
bufferprotected int count
buffer| 建構子詳細資訊 |
|---|
public StringBufferInputStream(String s)
s - 基本輸入緩衝區。| 方法詳細資訊 |
|---|
public int read()
0 到 255 範圍內的 int 位元組值。如果因串流的末尾已到達而沒有可用的位元組,則返回值 -1。
StringBufferInputStream 的 read 方法不會阻塞。它返回此輸入串流的緩衝區中下一個字元的低八位。
InputStream 中的 read-1。
public int read(byte[] b,
int off,
int len)
len 個資料位元組從此輸入串流讀入 byte 陣列。
StringBufferInputStream 的 read 方法不會阻塞。它將此輸入串流的緩衝區中字元的低八位複製到 byte 陣列參數中。
InputStream 中的 readb - 讀入資料的緩衝區。off - 資料的初始偏移量。len - 讀取的最多位元組數。
-1。InputStream.read()public long skip(long n)
n 個位元組。如果已到達輸入串流的末尾,則可能會跳過非常少的位元組。
InputStream 中的 skipn - 要跳過的位元組數。
public int available()
InputStream 中的 availablecount - pos 的值,它是要從輸入緩衝區中讀取的剩餘位元組數。public void reset()
InputStream 中的 resetInputStream.mark(int),
IOException
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。