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

public abstract class ImageInputStreamImpl2 extends ImageInputStreamImpl
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 Details

    • byteBuf

      protected byte[] byteBuf
      Byte 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