|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
java.lang.Objectjavax.imageio.stream.ImageInputStreamImpl
javax.imageio.stream.MemoryCacheImageInputStream
public class MemoryCacheImageInputStream
從常規 InputStream 獲取輸入的 ImageInputStream 的實作。記憶體緩衝區用於快取記憶體(至少)丟棄位置和當前讀取位置之間的資料。
一般而言,從常規 InputStream 進行讀取時最好使用 FileCacheImageInputStream。提供此類別用於不可能創建可寫入臨時檔案的情況。
| 欄位摘要 |
|---|
| 從類別 javax.imageio.stream.ImageInputStreamImpl 繼承的欄位 |
|---|
bitOffset, byteOrder, flushedPos, streamPos |
| 建構子摘要 | |
|---|---|
MemoryCacheImageInputStream(InputStream stream)
建構一個將從給定 InputStream 進行讀取的 MemoryCacheImageInputStream。 |
|
| 方法摘要 | |
|---|---|
void |
close()
關閉此 MemoryCacheImageInputStream,釋放快取記憶體。 |
protected void |
finalize()
在垃圾回收前結束此物件。 |
void |
flushBefore(long pos)
丟棄所指示位置之前的串流初始部分。 |
boolean |
isCached()
返回 true,因為此 ImageInputStream為了允許逆向尋找而快取記憶體了資料。 |
boolean |
isCachedFile()
返回 false,因為此 ImageInputStream 不維護檔案快取記憶體。 |
boolean |
isCachedMemory()
返回 true,因為此 ImageInputStream 維護主存快取記憶體。 |
int |
read()
從串流中讀取單個位元組,並以 int(0 到 255 之間)形式返回該位元組。 |
int |
read(byte[] b,
int off,
int len)
從串流中讀取至多 len 個位元組,並將其存儲到 b 中(從 off 索引處開始)。 |
| 從類別 javax.imageio.stream.ImageInputStreamImpl 繼承的方法 |
|---|
checkClosed, flush, 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 MemoryCacheImageInputStream(InputStream stream)
InputStream 進行讀取的 MemoryCacheImageInputStream。
stream - 要從其進行讀取的 InputStream。
IllegalArgumentException - 如果 stream 為 null。| 方法詳細資訊 |
|---|
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 void flushBefore(long pos)
throws IOException
ImageInputStream 複製的描述IndexOutOfBoundsException。
調用 flushBefore 可允許實作此介面的類別釋放存儲串流中的資料所使用的資源,如記憶體和磁碟空間。
ImageInputStream 中的 flushBeforeImageInputStreamImpl 中的 flushBeforepos - 一個 long,它包含要刷新的串流前綴的長度。
IOException - 如果發生 I/O 錯誤。public boolean isCached()
true,因為此 ImageInputStream為了允許逆向尋找而快取記憶體了資料。
ImageInputStream 中的 isCachedImageInputStreamImpl 中的 isCachedtrue。isCachedMemory(),
isCachedFile()public boolean isCachedFile()
false,因為此 ImageInputStream 不維護檔案快取記憶體。
ImageInputStream 中的 isCachedFileImageInputStreamImpl 中的 isCachedFilefalse。isCached(),
isCachedMemory()public boolean isCachedMemory()
true,因為此 ImageInputStream 維護主存快取記憶體。
ImageInputStream 中的 isCachedMemoryImageInputStreamImpl 中的 isCachedMemorytrue。isCached(),
isCachedFile()
public void close()
throws IOException
MemoryCacheImageInputStream,釋放快取記憶體。但不關閉源 InputStream。
ImageInputStream 中的 closeImageInputStreamImpl 中的 closeIOException - 如果發生 I/O 錯誤。
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。