|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
java.lang.Objectjava.io.OutputStream
java.io.FilterOutputStream
java.io.BufferedOutputStream
public class BufferedOutputStream
該類別實作緩衝的輸出串流。通過設置這種輸出串流,應用程序就可以將各個位元組寫入底層輸出串流中,而不必針對每次位元組寫入調用底層系統。
| 欄位摘要 | |
|---|---|
protected byte[] |
buf
存儲資料的內部緩衝區。 |
protected int |
count
緩衝區中的有效位元組數。 |
| 從類別 java.io.FilterOutputStream 繼承的欄位 |
|---|
out |
| 建構子摘要 | |
|---|---|
BufferedOutputStream(OutputStream out)
創建一個新的緩衝輸出串流,以將資料寫入指定的底層輸出串流。 |
|
BufferedOutputStream(OutputStream out,
int size)
創建一個新的緩衝輸出串流,以將具有指定緩衝區大小的資料寫入指定的底層輸出串流。 |
|
| 方法摘要 | |
|---|---|
void |
flush()
刷新此緩衝的輸出串流。 |
void |
write(byte[] b,
int off,
int len)
將指定 byte 陣列中從偏移量 off 開始的 len 個位元組寫入此緩衝的輸出串流。 |
void |
write(int b)
將指定的位元組寫入此緩衝的輸出串流。 |
| 從類別 java.io.FilterOutputStream 繼承的方法 |
|---|
close, write |
| 從類別 java.lang.Object 繼承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 欄位詳細資訊 |
|---|
protected byte[] buf
protected int count
| 建構子詳細資訊 |
|---|
public BufferedOutputStream(OutputStream out)
out - 底層輸出串流。
public BufferedOutputStream(OutputStream out,
int size)
out - 底層輸出串流。size - 緩衝區的大小。
IllegalArgumentException - 如果 size <= 0| 方法詳細資訊 |
|---|
public void write(int b)
throws IOException
FilterOutputStream 中的 writeb - 要寫入的位元組。
IOException - 如果發生 I/O 錯誤。
public void write(byte[] b,
int off,
int len)
throws IOException
off 開始的 len 個位元組寫入此緩衝的輸出串流。
一般來說,此方法將給定陣列的位元組存入此串流的緩衝區中,根據需要將該緩衝區刷新,並轉到底層輸出串流。但是,如果請求的長度至少與此串流的緩衝區大小相同,則此方法將刷新該緩衝區並將各個位元組直接寫入底層輸出串流。因此多餘的 BufferedOutputStream 將不必複製資料。
FilterOutputStream 中的 writeb - 資料。off - 資料的起始偏移量。len - 要寫入的位元組數。
IOException - 如果發生 I/O 錯誤。FilterOutputStream.write(int)
public void flush()
throws IOException
Flushable 中的 flushFilterOutputStream 中的 flushIOException - 如果發生 I/O 錯誤。FilterOutputStream.out
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。