Class ImageInputStreamImpl2
java.lang.Object
javax.imageio.stream.ImageInputStreamImpl
org.monte.media.io.ImageInputStreamImpl2
- All Implemented Interfaces:
Closeable,DataInput,AutoCloseable,ImageInputStream
- Direct Known Subclasses:
ByteArrayImageInputStream,FilterImageInputStream,SubImageInputStream,UncachedImageInputStream
ImageInputStreamImpl2 fixes bugs in ImageInputStreamImpl.
ImageInputStreamImpl uses read(byte[]) instead of readFully(byte[]) inside of readShort. This results in corrupt data input if the underlying stream can not fulfill the read operation in a single step.
- Author:
- Werner Randelshofer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected byte[]Byte buffer used for readFully(type[], int, int).Fields inherited from class javax.imageio.stream.ImageInputStreamImpl
bitOffset, byteOrder, flushedPos, streamPos -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class javax.imageio.stream.ImageInputStreamImpl
checkClosed, close, finalize, flush, flushBefore, getBitOffset, getByteOrder, getFlushedPosition, getStreamPosition, isCached, isCachedFile, isCachedMemory, length, mark, read, read, read, readBit, readBits, readBoolean, readByte, readBytes, readChar, readDouble, readFloat, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readLine, readLong, readUnsignedByte, readUnsignedInt, readUnsignedShort, readUTF, reset, seek, setBitOffset, setByteOrder, skipBytes, skipBytes
-
Field Details
-
byteBuf
protected byte[] byteBufByte buffer used for readFully(type[], int, int). Note that this array is also used for bulk reads in readShort(), readInt(), etc, so it should be large enough to hold a primitive value (i.e. >= 8 bytes). Also note that this array is package protected, so that it can be used by ImageOutputStreamImpl in a similar manner.
-
-
Constructor Details
-
ImageInputStreamImpl2
public ImageInputStreamImpl2()
-
-
Method Details
-
readShort
- Specified by:
readShortin interfaceDataInput- Specified by:
readShortin interfaceImageInputStream- Overrides:
readShortin classImageInputStreamImpl- Throws:
IOException
-
readInt
- Specified by:
readIntin interfaceDataInput- Specified by:
readIntin interfaceImageInputStream- Overrides:
readIntin classImageInputStreamImpl- Throws:
IOException
-