|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
java.lang.Objectjavax.imageio.stream.ImageInputStreamImpl
javax.imageio.stream.FileCacheImageInputStream
public class FileCacheImageInputStream
從常規 InputStream 獲取其輸入的 ImageInputStream 的實作。使用檔案快取記憶體以前讀取的資料。
| 欄位摘要 |
|---|
| 從類別 javax.imageio.stream.ImageInputStreamImpl 繼承的欄位 |
|---|
bitOffset, byteOrder, flushedPos, streamPos |
| 建構子摘要 | |
|---|---|
FileCacheImageInputStream(InputStream stream,
File cacheDir)
建構一個將從給定 InputStream 進行讀取的 FileCacheImageInputStream。 |
|
| 方法摘要 | |
|---|---|
void |
close()
關閉此 FileCacheImageInputStream,關閉並移除快取記憶體檔案。 |
protected void |
finalize()
在垃圾回收前結束此物件。 |
boolean |
isCached()
返回 true,因為此 ImageInputStream 為了允許逆向尋找而快取記憶體了資料。 |
boolean |
isCachedFile()
返回 true,因為此 ImageInputStream 維護檔案快取記憶體。 |
boolean |
isCachedMemory()
返回 false,因為此 ImageInputStream 不維護主存快取記憶體。 |
int |
read()
從串流中讀取單個位元組,並以 int(0 到 255 之間)形式返回該位元組。 |
int |
read(byte[] b,
int off,
int len)
從串流中讀取至多 len 個位元組,並將其存儲到 b 中(從 off 索引處開始)。 |
| 從類別 javax.imageio.stream.ImageInputStreamImpl 繼承的方法 |
|---|
checkClosed, flush, flushBefore, getBitOffset, getByteOrder, getFlushedPosition, getStreamPosition, length, mark, read, readBit, readBits, readBoolean, readByte, readBytes, readChar, readDouble, readFloat, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedInt, readUnsignedShort, readUTF, reset, seek, setBitOffset, setByteOrder, skipBytes, skipBytes |
| 從類別 java.lang.Object 繼承的方法 |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 建構子詳細資訊 |
|---|
public FileCacheImageInputStream(InputStream stream,
File cacheDir)
throws IOException
InputStream 進行讀取的 FileCacheImageInputStream。
將臨時檔案用作快取記憶體。如果 cacheDir 不為 null 且是一個目錄,則在該處創建檔案。如果為 null,則使用與系統相關的預設臨時檔案目錄(有關詳細資料,請參閱 File.createTempFile 的文檔)。
stream - 要從其進行讀取的 InputStream。cacheDir - 一個指示快取記憶體檔案創建目錄的 File;或 null,指示使用系統目錄。
IllegalArgumentException - 如果 stream 為 null。
IllegalArgumentException - 如果 cacheDir 不為 null 但不是一個目錄。
IOException - 如果無法創建快取記憶體檔案。| 方法詳細資訊 |
|---|
public int read()
throws IOException
ImageInputStreamImpl 複製的描述int(0 到 255 之間)形式返回該位元組。 如果到達 EOF,則返回 -1。
子類別必須提供此方法的實作。子類別實作在退出前應該更新串流位置。
在發生讀取前,串流中的位偏移量必須被重置為 0。
ImageInputStream 中的 readImageInputStreamImpl 中的 read-1。
IOException - 如果串流已經被關閉。
public int read(byte[] b,
int off,
int len)
throws IOException
ImageInputStreamImpl 複製的描述len 個位元組,並將其存儲到 b 中(從 off 索引處開始)。如果由於到達串流末尾而沒有讀取任何位元組,則返回 -1。
在發生讀取前,串流中的位偏移量必須被重置為 0。
子類別必須提供此方法的實作。子類別實作在退出前應該更新串流位置。
ImageInputStream 中的 readImageInputStreamImpl 中的 readb - 用來接收寫入的位元組陣列。off - b 中要寫入的起始位置。len - 要讀取的最大位元組數。
-1,指示 EOF。
IOException - 如果發生 I/O 錯誤。public boolean isCached()
true,因為此 ImageInputStream 為了允許逆向尋找而快取記憶體了資料。
ImageInputStream 中的 isCachedImageInputStreamImpl 中的 isCachedtrue。isCachedMemory(),
isCachedFile()public boolean isCachedFile()
true,因為此 ImageInputStream 維護檔案快取記憶體。
ImageInputStream 中的 isCachedFileImageInputStreamImpl 中的 isCachedFiletrue。isCached(),
isCachedMemory()public boolean isCachedMemory()
false,因為此 ImageInputStream 不維護主存快取記憶體。
ImageInputStream 中的 isCachedMemoryImageInputStreamImpl 中的 isCachedMemoryfalse。isCached(),
isCachedFile()
public void close()
throws IOException
FileCacheImageInputStream,關閉並移除快取記憶體檔案。但不關閉源 InputStream。
ImageInputStream 中的 closeImageInputStreamImpl 中的 closeIOException - 如果發生錯誤。
protected void finalize()
throws Throwable
close 方法來關閉所有開啟的輸入源。不應該從應用程序程式碼調用此方法。
ImageInputStreamImpl 中的 finalizeThrowable - 如果在父級類別終止過程中發生錯誤。
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。