Package com.twelvemonkeys.imageio.stream
Class BufferedImageInputStream
- java.lang.Object
-
- javax.imageio.stream.ImageInputStreamImpl
-
- com.twelvemonkeys.imageio.stream.BufferedImageInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.DataInput,java.lang.AutoCloseable,javax.imageio.stream.ImageInputStream
@Deprecated public final class BufferedImageInputStream extends javax.imageio.stream.ImageInputStreamImpl implements javax.imageio.stream.ImageInputStreamDeprecated.UseBufferedFileImageInputStreaminstead.A bufferedImageInputStream. Experimental - seems to be effective forFileImageInputStreamandFileCacheImageInputStreamwhen doing a lot of single-byte reads (or short byte-array reads). Code that uses thereadFullymethods are not affected by the issue.NOTE: Invoking
close()will NOT close the wrapped stream.- Version:
- $Id: BufferedFileImageInputStream.java,v 1.0 May 15, 2008 4:36:49 PM haraldk Exp$
-
-
Field Summary
Fields Modifier and Type Field Description private java.nio.ByteBufferbufferDeprecated.(package private) static intDEFAULT_BUFFER_SIZEDeprecated.private java.nio.ByteBufferintegralCacheDeprecated.private byte[]integralCacheArrayDeprecated.private javax.imageio.stream.ImageInputStreamstreamDeprecated.
-
Constructor Summary
Constructors Modifier Constructor Description BufferedImageInputStream(javax.imageio.stream.ImageInputStream pStream)Deprecated.privateBufferedImageInputStream(javax.imageio.stream.ImageInputStream pStream, int pBufferSize)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidclose()Deprecated.private voidfillBuffer()Deprecated.protected voidfinalize()Deprecated.voidflushBefore(long pos)Deprecated.longgetFlushedPosition()Deprecated.booleanisCached()Deprecated.booleanisCachedFile()Deprecated.booleanisCachedMemory()Deprecated.longlength()Deprecated.intread()Deprecated.intread(byte[] pBuffer, int pOffset, int pLength)Deprecated.intreadBit()Deprecated.longreadBits(int numBits)Deprecated.private intreadBuffered(byte[] pBuffer, int pOffset, int pLength)Deprecated.private intreadDirect(byte[] pBuffer, int pOffset, int pLength)Deprecated.intreadInt()Deprecated.longreadLong()Deprecated.shortreadShort()Deprecated.voidseek(long position)Deprecated.voidsetByteOrder(java.nio.ByteOrder byteOrder)Deprecated.-
Methods inherited from class javax.imageio.stream.ImageInputStreamImpl
checkClosed, flush, getBitOffset, getByteOrder, getStreamPosition, mark, read, readBoolean, readByte, readBytes, readChar, readDouble, readFloat, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readLine, readUnsignedByte, readUnsignedInt, readUnsignedShort, readUTF, reset, setBitOffset, skipBytes, skipBytes
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.imageio.stream.ImageInputStream
flush, getBitOffset, getByteOrder, getStreamPosition, mark, read, readBoolean, readByte, readBytes, readChar, readDouble, readFloat, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readLine, readUnsignedByte, readUnsignedInt, readUnsignedShort, readUTF, reset, setBitOffset, skipBytes, skipBytes
-
-
-
-
Field Detail
-
DEFAULT_BUFFER_SIZE
static final int DEFAULT_BUFFER_SIZE
Deprecated.- See Also:
- Constant Field Values
-
stream
private javax.imageio.stream.ImageInputStream stream
Deprecated.
-
buffer
private java.nio.ByteBuffer buffer
Deprecated.
-
integralCache
private final java.nio.ByteBuffer integralCache
Deprecated.
-
integralCacheArray
private final byte[] integralCacheArray
Deprecated.
-
-
Constructor Detail
-
BufferedImageInputStream
public BufferedImageInputStream(javax.imageio.stream.ImageInputStream pStream) throws java.io.IOExceptionDeprecated.- Throws:
java.io.IOException
-
BufferedImageInputStream
private BufferedImageInputStream(javax.imageio.stream.ImageInputStream pStream, int pBufferSize) throws java.io.IOExceptionDeprecated.- Throws:
java.io.IOException
-
-
Method Detail
-
fillBuffer
private void fillBuffer() throws java.io.IOExceptionDeprecated.- Throws:
java.io.IOException
-
setByteOrder
public void setByteOrder(java.nio.ByteOrder byteOrder)
Deprecated.- Specified by:
setByteOrderin interfacejavax.imageio.stream.ImageInputStream- Overrides:
setByteOrderin classjavax.imageio.stream.ImageInputStreamImpl
-
read
public int read() throws java.io.IOExceptionDeprecated.- Specified by:
readin interfacejavax.imageio.stream.ImageInputStream- Specified by:
readin classjavax.imageio.stream.ImageInputStreamImpl- Throws:
java.io.IOException
-
read
public int read(byte[] pBuffer, int pOffset, int pLength) throws java.io.IOExceptionDeprecated.- Specified by:
readin interfacejavax.imageio.stream.ImageInputStream- Specified by:
readin classjavax.imageio.stream.ImageInputStreamImpl- Throws:
java.io.IOException
-
readDirect
private int readDirect(byte[] pBuffer, int pOffset, int pLength) throws java.io.IOExceptionDeprecated.- Throws:
java.io.IOException
-
readBuffered
private int readBuffered(byte[] pBuffer, int pOffset, int pLength)Deprecated.
-
readShort
public short readShort() throws java.io.IOExceptionDeprecated.- Specified by:
readShortin interfacejava.io.DataInput- Specified by:
readShortin interfacejavax.imageio.stream.ImageInputStream- Overrides:
readShortin classjavax.imageio.stream.ImageInputStreamImpl- Throws:
java.io.IOException
-
readInt
public int readInt() throws java.io.IOExceptionDeprecated.- Specified by:
readIntin interfacejava.io.DataInput- Specified by:
readIntin interfacejavax.imageio.stream.ImageInputStream- Overrides:
readIntin classjavax.imageio.stream.ImageInputStreamImpl- Throws:
java.io.IOException
-
readLong
public long readLong() throws java.io.IOExceptionDeprecated.- Specified by:
readLongin interfacejava.io.DataInput- Specified by:
readLongin interfacejavax.imageio.stream.ImageInputStream- Overrides:
readLongin classjavax.imageio.stream.ImageInputStreamImpl- Throws:
java.io.IOException
-
readBit
public int readBit() throws java.io.IOExceptionDeprecated.- Specified by:
readBitin interfacejavax.imageio.stream.ImageInputStream- Overrides:
readBitin classjavax.imageio.stream.ImageInputStreamImpl- Throws:
java.io.IOException
-
readBits
public long readBits(int numBits) throws java.io.IOExceptionDeprecated.- Specified by:
readBitsin interfacejavax.imageio.stream.ImageInputStream- Overrides:
readBitsin classjavax.imageio.stream.ImageInputStreamImpl- Throws:
java.io.IOException
-
seek
public void seek(long position) throws java.io.IOExceptionDeprecated.- Specified by:
seekin interfacejavax.imageio.stream.ImageInputStream- Overrides:
seekin classjavax.imageio.stream.ImageInputStreamImpl- Throws:
java.io.IOException
-
flushBefore
public void flushBefore(long pos) throws java.io.IOExceptionDeprecated.- Specified by:
flushBeforein interfacejavax.imageio.stream.ImageInputStream- Overrides:
flushBeforein classjavax.imageio.stream.ImageInputStreamImpl- Throws:
java.io.IOException
-
getFlushedPosition
public long getFlushedPosition()
Deprecated.- Specified by:
getFlushedPositionin interfacejavax.imageio.stream.ImageInputStream- Overrides:
getFlushedPositionin classjavax.imageio.stream.ImageInputStreamImpl
-
isCached
public boolean isCached()
Deprecated.- Specified by:
isCachedin interfacejavax.imageio.stream.ImageInputStream- Overrides:
isCachedin classjavax.imageio.stream.ImageInputStreamImpl
-
isCachedMemory
public boolean isCachedMemory()
Deprecated.- Specified by:
isCachedMemoryin interfacejavax.imageio.stream.ImageInputStream- Overrides:
isCachedMemoryin classjavax.imageio.stream.ImageInputStreamImpl
-
isCachedFile
public boolean isCachedFile()
Deprecated.- Specified by:
isCachedFilein interfacejavax.imageio.stream.ImageInputStream- Overrides:
isCachedFilein classjavax.imageio.stream.ImageInputStreamImpl
-
close
public void close() throws java.io.IOExceptionDeprecated.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfacejavax.imageio.stream.ImageInputStream- Overrides:
closein classjavax.imageio.stream.ImageInputStreamImpl- Throws:
java.io.IOException
-
finalize
protected void finalize() throws java.lang.ThrowableDeprecated.- Overrides:
finalizein classjavax.imageio.stream.ImageInputStreamImpl- Throws:
java.lang.Throwable
-
length
public long length()
Deprecated.- Specified by:
lengthin interfacejavax.imageio.stream.ImageInputStream- Overrides:
lengthin classjavax.imageio.stream.ImageInputStreamImpl
-
-