|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
java.lang.Objectjavax.imageio.stream.ImageInputStreamImpl
javax.imageio.stream.ImageOutputStreamImpl
javax.imageio.stream.MemoryCacheImageOutputStream
public class MemoryCacheImageOutputStream
將輸出寫入常規 OutputStream 中的 ImageOutputStream 的實作。記憶體緩衝區用於快取記憶體(至少)丟棄位置和當前寫入位置之間的資料。唯一的建構子帶有一個 OutputStream,因此此類別不能用於讀取/修改/寫入操作。讀取操作只能發生在那些已經被寫入到快取記憶體且尚未被刷新的串流部分。
| 欄位摘要 |
|---|
| 從類別 javax.imageio.stream.ImageInputStreamImpl 繼承的欄位 |
|---|
bitOffset, byteOrder, flushedPos, streamPos |
| 建構子摘要 | |
|---|---|
MemoryCacheImageOutputStream(OutputStream stream)
建構將向給定 OutputStream 進行寫入的 MemoryCacheImageOutputStream。 |
|
| 方法摘要 | |
|---|---|
void |
close()
關閉此 MemoryCacheImageOutputStream。 |
void |
flushBefore(long pos)
丟棄所指示位置之前的串流初始部分。 |
boolean |
isCached()
返回 true,因為此 ImageOutputStream為了允許逆向尋找而快取記憶體了資料。 |
boolean |
isCachedFile()
返回 false,因為此 ImageOutputStream 不維護檔案快取記憶體。 |
boolean |
isCachedMemory()
返回 true,因為此 ImageOutputStream 維護主存快取記憶體。 |
long |
length()
返回 -1L,指示串流的長度未知。 |
int |
read()
從串流中讀取單個位元組,並以 int(0 到 255 之間)形式返回該位元組。 |
int |
read(byte[] b,
int off,
int len)
從串流中讀取至多 len 個位元組,並將其存儲到 b 中(從 off 索引處開始)。 |
void |
write(byte[] b,
int off,
int len)
將位元組序列寫入到串流中的當前位置。 |
void |
write(int b)
將單個位元組寫入到串流中的當前位置。 |
| 從類別 javax.imageio.stream.ImageOutputStreamImpl 繼承的方法 |
|---|
flushBits, write, writeBit, writeBits, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeChars, writeDouble, writeDoubles, writeFloat, writeFloats, writeInt, writeInts, writeLong, writeLongs, writeShort, writeShorts, writeUTF |
| 從類別 javax.imageio.stream.ImageInputStreamImpl 繼承的方法 |
|---|
checkClosed, finalize, flush, getBitOffset, getByteOrder, getFlushedPosition, getStreamPosition, 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 |
| 從介面 javax.imageio.stream.ImageInputStream 繼承的方法 |
|---|
flush, getBitOffset, getByteOrder, getFlushedPosition, getStreamPosition, 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 |
| 建構子詳細資訊 |
|---|
public MemoryCacheImageOutputStream(OutputStream stream)
OutputStream 進行寫入的 MemoryCacheImageOutputStream。
stream - 將寫入到的 OutputStream。
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 write(int b)
throws IOException
ImageOutputStream 複製的描述b 的 24 個高位將被忽略。
如果串流中的位偏移量不為零,則首先將當前位元組的余項用 0 填充並將其寫出。寫出後位偏移量將為 0。實作方可使用 的 ImageOutputStreamImpl 方法來保證這一點。
flushBits
DataOutput 中的 writeImageOutputStream 中的 writeImageOutputStreamImpl 中的 writeb - 一個 int,其低 8 位將被寫入。
IOException - 如果發生 I/O 錯誤。
public void write(byte[] b,
int off,
int len)
throws IOException
ImageOutputStream 複製的描述len 為 0,則不寫入任何位元組。首先寫入位元組 b[off],然後寫入位元組 b[off + 1],依此類別推。
如果串流中的位偏移量不為零,則首先將當前位元組的余項用 0 填充並將其寫出。寫出後位偏移量將為 0。實作方可使用 的 ImageOutputStreamImpl 方法來保證這一點。
flushBits
DataOutput 中的 writeImageOutputStream 中的 writeImageOutputStreamImpl 中的 writeb - 要寫入的 byte 陣列。off - 資料中的初始偏移量。len - 要寫入的 byte 數。
IOException - 如果發生 I/O 錯誤。public long length()
ImageInputStreamImpl 複製的描述-1L,指示串流的長度未知。子類別必須覆寫此方法來提供實際的長度資訊。
ImageInputStream 中的 lengthImageInputStreamImpl 中的 lengthpublic boolean isCached()
true,因為此 ImageOutputStream為了允許逆向尋找而快取記憶體了資料。
ImageInputStream 中的 isCachedImageInputStreamImpl 中的 isCachedtrue。isCachedMemory(),
isCachedFile()public boolean isCachedFile()
false,因為此 ImageOutputStream 不維護檔案快取記憶體。
ImageInputStream 中的 isCachedFileImageInputStreamImpl 中的 isCachedFilefalse。isCached(),
isCachedMemory()public boolean isCachedMemory()
true,因為此 ImageOutputStream 維護主存快取記憶體。
ImageInputStream 中的 isCachedMemoryImageInputStreamImpl 中的 isCachedMemorytrue。isCached(),
isCachedFile()
public void close()
throws IOException
MemoryCacheImageOutputStream。所有的掛起資料都將被刷新到輸出,釋放該快取記憶體。但不關閉目標 OutputStream。
ImageInputStream 中的 closeImageInputStreamImpl 中的 closeIOException - 如果發生 I/O 錯誤。
public void flushBefore(long pos)
throws IOException
ImageInputStream 複製的描述IndexOutOfBoundsException。
調用 flushBefore 可允許實作此介面的類別釋放存儲串流中的資料所使用的資源,如記憶體和磁碟空間。
ImageInputStream 中的 flushBeforeImageOutputStream 中的 flushBeforeImageInputStreamImpl 中的 flushBeforepos - 一個 long,它包含要刷新的串流前綴的長度。
IOException - 如果發生 I/O 錯誤。
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。