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.ImageInputStream
Deprecated.UseBufferedFileImageInputStream
instead.A bufferedImageInputStream
. Experimental - seems to be effective forFileImageInputStream
andFileCacheImageInputStream
when doing a lot of single-byte reads (or short byte-array reads). Code that uses thereadFully
methods 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.ByteBuffer
buffer
Deprecated.(package private) static int
DEFAULT_BUFFER_SIZE
Deprecated.private java.nio.ByteBuffer
integralCache
Deprecated.private byte[]
integralCacheArray
Deprecated.private javax.imageio.stream.ImageInputStream
stream
Deprecated.
-
Constructor Summary
Constructors Modifier Constructor Description BufferedImageInputStream(javax.imageio.stream.ImageInputStream pStream)
Deprecated.private
BufferedImageInputStream(javax.imageio.stream.ImageInputStream pStream, int pBufferSize)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
close()
Deprecated.private void
fillBuffer()
Deprecated.protected void
finalize()
Deprecated.void
flushBefore(long pos)
Deprecated.long
getFlushedPosition()
Deprecated.boolean
isCached()
Deprecated.boolean
isCachedFile()
Deprecated.boolean
isCachedMemory()
Deprecated.long
length()
Deprecated.int
read()
Deprecated.int
read(byte[] pBuffer, int pOffset, int pLength)
Deprecated.int
readBit()
Deprecated.long
readBits(int numBits)
Deprecated.private int
readBuffered(byte[] pBuffer, int pOffset, int pLength)
Deprecated.private int
readDirect(byte[] pBuffer, int pOffset, int pLength)
Deprecated.int
readInt()
Deprecated.long
readLong()
Deprecated.short
readShort()
Deprecated.void
seek(long position)
Deprecated.void
setByteOrder(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.IOException
Deprecated.- Throws:
java.io.IOException
-
BufferedImageInputStream
private BufferedImageInputStream(javax.imageio.stream.ImageInputStream pStream, int pBufferSize) throws java.io.IOException
Deprecated.- Throws:
java.io.IOException
-
-
Method Detail
-
fillBuffer
private void fillBuffer() throws java.io.IOException
Deprecated.- Throws:
java.io.IOException
-
setByteOrder
public void setByteOrder(java.nio.ByteOrder byteOrder)
Deprecated.- Specified by:
setByteOrder
in interfacejavax.imageio.stream.ImageInputStream
- Overrides:
setByteOrder
in classjavax.imageio.stream.ImageInputStreamImpl
-
read
public int read() throws java.io.IOException
Deprecated.- Specified by:
read
in interfacejavax.imageio.stream.ImageInputStream
- Specified by:
read
in classjavax.imageio.stream.ImageInputStreamImpl
- Throws:
java.io.IOException
-
read
public int read(byte[] pBuffer, int pOffset, int pLength) throws java.io.IOException
Deprecated.- Specified by:
read
in interfacejavax.imageio.stream.ImageInputStream
- Specified by:
read
in classjavax.imageio.stream.ImageInputStreamImpl
- Throws:
java.io.IOException
-
readDirect
private int readDirect(byte[] pBuffer, int pOffset, int pLength) throws java.io.IOException
Deprecated.- Throws:
java.io.IOException
-
readBuffered
private int readBuffered(byte[] pBuffer, int pOffset, int pLength)
Deprecated.
-
readShort
public short readShort() throws java.io.IOException
Deprecated.- Specified by:
readShort
in interfacejava.io.DataInput
- Specified by:
readShort
in interfacejavax.imageio.stream.ImageInputStream
- Overrides:
readShort
in classjavax.imageio.stream.ImageInputStreamImpl
- Throws:
java.io.IOException
-
readInt
public int readInt() throws java.io.IOException
Deprecated.- Specified by:
readInt
in interfacejava.io.DataInput
- Specified by:
readInt
in interfacejavax.imageio.stream.ImageInputStream
- Overrides:
readInt
in classjavax.imageio.stream.ImageInputStreamImpl
- Throws:
java.io.IOException
-
readLong
public long readLong() throws java.io.IOException
Deprecated.- Specified by:
readLong
in interfacejava.io.DataInput
- Specified by:
readLong
in interfacejavax.imageio.stream.ImageInputStream
- Overrides:
readLong
in classjavax.imageio.stream.ImageInputStreamImpl
- Throws:
java.io.IOException
-
readBit
public int readBit() throws java.io.IOException
Deprecated.- Specified by:
readBit
in interfacejavax.imageio.stream.ImageInputStream
- Overrides:
readBit
in classjavax.imageio.stream.ImageInputStreamImpl
- Throws:
java.io.IOException
-
readBits
public long readBits(int numBits) throws java.io.IOException
Deprecated.- Specified by:
readBits
in interfacejavax.imageio.stream.ImageInputStream
- Overrides:
readBits
in classjavax.imageio.stream.ImageInputStreamImpl
- Throws:
java.io.IOException
-
seek
public void seek(long position) throws java.io.IOException
Deprecated.- Specified by:
seek
in interfacejavax.imageio.stream.ImageInputStream
- Overrides:
seek
in classjavax.imageio.stream.ImageInputStreamImpl
- Throws:
java.io.IOException
-
flushBefore
public void flushBefore(long pos) throws java.io.IOException
Deprecated.- Specified by:
flushBefore
in interfacejavax.imageio.stream.ImageInputStream
- Overrides:
flushBefore
in classjavax.imageio.stream.ImageInputStreamImpl
- Throws:
java.io.IOException
-
getFlushedPosition
public long getFlushedPosition()
Deprecated.- Specified by:
getFlushedPosition
in interfacejavax.imageio.stream.ImageInputStream
- Overrides:
getFlushedPosition
in classjavax.imageio.stream.ImageInputStreamImpl
-
isCached
public boolean isCached()
Deprecated.- Specified by:
isCached
in interfacejavax.imageio.stream.ImageInputStream
- Overrides:
isCached
in classjavax.imageio.stream.ImageInputStreamImpl
-
isCachedMemory
public boolean isCachedMemory()
Deprecated.- Specified by:
isCachedMemory
in interfacejavax.imageio.stream.ImageInputStream
- Overrides:
isCachedMemory
in classjavax.imageio.stream.ImageInputStreamImpl
-
isCachedFile
public boolean isCachedFile()
Deprecated.- Specified by:
isCachedFile
in interfacejavax.imageio.stream.ImageInputStream
- Overrides:
isCachedFile
in classjavax.imageio.stream.ImageInputStreamImpl
-
close
public void close() throws java.io.IOException
Deprecated.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Specified by:
close
in interfacejavax.imageio.stream.ImageInputStream
- Overrides:
close
in classjavax.imageio.stream.ImageInputStreamImpl
- Throws:
java.io.IOException
-
finalize
protected void finalize() throws java.lang.Throwable
Deprecated.- Overrides:
finalize
in classjavax.imageio.stream.ImageInputStreamImpl
- Throws:
java.lang.Throwable
-
length
public long length()
Deprecated.- Specified by:
length
in interfacejavax.imageio.stream.ImageInputStream
- Overrides:
length
in classjavax.imageio.stream.ImageInputStreamImpl
-
-