|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
java.lang.Objectjava.io.OutputStream
java.io.FilterOutputStream
public class FilterOutputStream
此類別是過濾輸出串流的全部類別的父級類別。這些串流位於已存在的輸出串流(基礎 輸出串流)之上,它們將已存在的輸出串流作為其基本資料接收器,但可能直接傳輸資料或提供一些額外的功能。
FilterOutputStream 類別本身只是簡單地覆寫那些將所有請求傳遞給所包含輸出串流的 OutputStream 的所有方法。FilterOutputStream 的子類別可進一步地覆寫這些方法中的一些方法,並且還可以提供一些額外的方法和欄位。
| 欄位摘要 | |
|---|---|
protected OutputStream |
out
要過濾的基礎輸出串流。 |
| 建構子摘要 | |
|---|---|
FilterOutputStream(OutputStream out)
創建一個建構在指定基礎輸出串流之上的輸出串流過濾器。 |
|
| 方法摘要 | |
|---|---|
void |
close()
關閉此輸出串流並釋放與此串流有關的所有系統資源。 |
void |
flush()
刷新此輸出串流,並強制將所有已緩衝的輸出位元組寫入該串流中。 |
void |
write(byte[] b)
將 b.length 個位元組寫入此輸出串流。 |
void |
write(byte[] b,
int off,
int len)
將指定 byte 陣列中從偏移量 off 開始的 len 個位元組寫入此輸出串流。 |
void |
write(int b)
將指定 byte 寫入此輸出串流。 |
| 從類別 java.lang.Object 繼承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 欄位詳細資訊 |
|---|
protected OutputStream out
| 建構子詳細資訊 |
|---|
public FilterOutputStream(OutputStream out)
out - 分派給欄位 this.out 以便以後使用的基礎輸出串流,如果將在沒有底層串流的情況下創建此實例,則該參數為 null。| 方法詳細資訊 |
|---|
public void write(int b)
throws IOException
byte 寫入此輸出串流。
FilterOutputStream 的 write 方法調用其基礎輸出串流的 write 方法,也就是說,它執行 out.write(b)。
實作 OutputStream 的抽象 write 方法。
OutputStream 中的 writeb - byte。
IOException - 如果發生 I/O 錯誤。
public void write(byte[] b)
throws IOException
b.length 個位元組寫入此輸出串流。
FilterOutputStream 的 write 方法將 b、0 和 b.length 作為三個參數來調用 write 方法。
注意,此方法不調用其底層串流的只帶有單個參數 b 的 write 方法。
OutputStream 中的 writeb - 要寫入的資料。
IOException - 如果發生 I/O 錯誤。write(byte[], int, int)
public void write(byte[] b,
int off,
int len)
throws IOException
byte 陣列中從偏移量 off 開始的 len 個位元組寫入此輸出串流。
FilterOutputStream 的 write 方法依次調用帶一個參數的 write 方法來輸出每個 byte。
注意,此方法不會調用其基礎輸入串流的帶有相同參數的 write 方法。FilterOutputStream 的子類別應該提供此方法更有效的實作。
OutputStream 中的 writeb - 資料。off - 資料中的起始偏移量。len - 要寫入的位元組數。
IOException - 如果發生 I/O 錯誤。write(int)
public void flush()
throws IOException
FilterOutputStream 的 flush 方法調用其基礎輸出串流的 flush 方法。
Flushable 中的 flushOutputStream 中的 flushIOException - 如果發生 I/O 錯誤。out
public void close()
throws IOException
FilterOutputStream 的 close 方法先調用其 flush 方法,然後調用其基礎輸出串流的 close 方法。
Closeable 中的 closeOutputStream 中的 closeIOException - 如果發生 I/O 錯誤。flush(),
out
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。