- java.lang.Object
-
- javax.imageio.stream.ImageInputStreamImpl
-
- javax.imageio.stream.MemoryCacheImageInputStream
-
- 实现的所有接口
-
Closeable,DataInput,AutoCloseable,ImageInputStream
public class MemoryCacheImageInputStream extends ImageInputStreamImpl
ImageInputStream的实现,从常规InputStream获取其输入。 存储缓冲器用于至少缓存丢弃位置和当前读取位置之间的数据。一般地,它是优选使用
FileCacheImageInputStream从常规读出时InputStream。 此类适用于无法创建可写临时文件的情况。
-
-
字段汇总
-
声明的属性在类 javax.imageio.stream.ImageInputStreamImpl
bitOffset, byteOrder, flushedPos, streamPos
-
-
构造方法摘要
构造方法 构造器 描述 MemoryCacheImageInputStream(InputStream stream)构造一个MemoryCacheImageInputStream,它将从给定的InputStream读取。
-
方法摘要
所有方法 实例方法 具体的方法 弃用的方法 变量和类型 方法 描述 voidclose()关闭此MemoryCacheImageInputStream,释放缓存。protected voidfinalize()已过时。finalize方法已被弃用。booleanisCached()返回true因为此ImageInputStream缓存数据以便允许向后搜索。booleanisCachedFile()返回false因为此ImageInputStream不维护文件缓存。booleanisCachedMemory()返回true因为此ImageInputStream维护主内存缓存。-
声明方法的类 javax.imageio.stream.ImageInputStreamImpl
checkClosed, length, mark, read, read, read, reset, skipBytes, skipBytes
-
声明方法的类 java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
声明方法的接口 javax.imageio.stream.ImageInputStream
flush, flushBefore, getBitOffset, getByteOrder, getFlushedPosition, getStreamPosition, readBit, readBits, readBoolean, readByte, readBytes, readChar, readDouble, readFloat, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedInt, readUnsignedShort, readUTF, seek, setBitOffset, setByteOrder
-
-
-
-
构造方法详细信息
-
MemoryCacheImageInputStream
public MemoryCacheImageInputStream(InputStream stream)
构造一个MemoryCacheImageInputStream,它将从给定的InputStream读取。- 参数
-
stream- 从InputStream进行阅读。 - 异常
-
IllegalArgumentException- 如果stream是null。
-
-
方法详细信息
-
isCached
public boolean isCached()
返回true因为此ImageInputStream缓存数据以便允许向后搜索。- Specified by:
-
isCached在界面ImageInputStream - 重写:
-
isCached类ImageInputStreamImpl - 结果
-
true。 - 另请参见:
-
isCachedMemory(),isCachedFile()
-
isCachedFile
public boolean isCachedFile()
返回false因为此ImageInputStream不维护文件缓存。- Specified by:
-
isCachedFile在界面ImageInputStream - 重写:
-
isCachedFile在类ImageInputStreamImpl - 结果
-
false。 - 另请参见:
-
isCached(),isCachedMemory()
-
isCachedMemory
public boolean isCachedMemory()
返回true因为此ImageInputStream维护主内存缓存。- Specified by:
-
isCachedMemory,界面ImageInputStream - 重写:
-
isCachedMemory在类ImageInputStreamImpl - 结果
-
true。 - 另请参见:
-
isCached(),isCachedFile()
-
close
public void close() throws IOException关闭此MemoryCacheImageInputStream,释放缓存。 源InputStream未关闭。- 异常
-
IOException- 如果发生I / O错误。
-
finalize
@Deprecated(since="9") protected void finalize() throws Throwable
Deprecated.Thefinalizemethod has been deprecated. Subclasses that overridefinalizein order to perform cleanup should be modified to use alternative cleanup mechanisms and to remove the overridingfinalizemethod. When overriding thefinalizemethod, its implementation must explicitly ensure thatsuper.finalize()is invoked as described inObject.finalize(). See the specification forObject.finalize()for further information about migration options.在垃圾回收之前完成此对象。 调用close方法以关闭任何打开的输入源。 不应从应用程序代码调用此方法。- 重写:
-
finalize类ImageInputStreamImpl - 异常
-
Throwable- 如果在超类完成期间发生错误。 - 另请参见:
-
WeakReference,PhantomReference
-
-