Package ghidra.program.model.data

# Class MemBufferImageInputStream

java.lang.Object
javax.imageio.stream.ImageInputStreamImpl
ghidra.program.model.data.MemBufferImageInputStream

All Implemented Interfaces:
  `Closeable`, `DataInput`, `AutoCloseable`, `ImageInputStream`

public class MemBufferImageInputStream extends ImageInputStreamImpl
ImageInputStream for reading images that wraps a MemBuffer to get the bytes. Adds a method to find out how many bytes were read by the imageReader to read the image.

- ## Field Summary

  ### Fields inherited from class javax.imageio.stream.ImageInputStreamImpl

  `bitOffset, byteOrder, flushedPos, streamPos`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MemBufferImageInputStream(MemBuffer buf, ByteOrder byteOrder)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `getConsumedLength()`
  `int`
  `read()`
  `int`
  `read(byte[] b, int off, int len)`

  ### Methods inherited from class javax.imageio.stream.ImageInputStreamImpl

  `checkClosed, close, finalize, flush, flushBefore, getBitOffset, getByteOrder, getFlushedPosition, getStreamPosition, isCached, isCachedFile, isCachedMemory, length, mark, read, readBit, readBits, readBoolean, readByte, readBytes, readChar, readDouble, readFloat, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedInt, readUnsignedShort, readUTF, reset, seek, setBitOffset, setByteOrder, skipBytes, skipBytes`

  ### Methods inherited from class java.lang.Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### MemBufferImageInputStream

    public MemBufferImageInputStream(MemBuffer buf, ByteOrder byteOrder)

- ## Method Details

  - ### getConsumedLength

    public int getConsumedLength()

  - ### read

    public int read() throws IOException
    Specified by:
      `read` in interface `ImageInputStream`
    Specified by:
      `read` in class `ImageInputStreamImpl`
    Throws:
      `IOException`

  - ### read

    public int read(byte[] b, int off, int len) throws IOException
    Specified by:
      `read` in interface `ImageInputStream`
    Specified by:
      `read` in class `ImageInputStreamImpl`
    Throws:
      `IOException`