Package ghidra.app.util.bin

# Class ByteProviderInputStream

java.lang.Object
java.io.InputStream
ghidra.app.util.bin.ByteProviderInputStream

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`

Direct Known Subclasses:
  `ByteProviderInputStream.ClosingInputStream`

public class ByteProviderInputStream extends InputStream
An `InputStream` that reads from a `ByteProvider`.

Does not close the underlying ByteProvider when closed itself.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `ByteProviderInputStream.ClosingInputStream`
  An `InputStream` that reads from a `ByteProvider`, and DOES `close()` the underlying ByteProvider when closed itself.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected ByteProvider`
  `provider`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ByteProviderInputStream(ByteProvider provider)`
  Creates an InputStream that uses a ByteProvider as its source of bytes.
  `ByteProviderInputStream(ByteProvider provider, long startPosition)`
  Creates an InputStream that uses a ByteProvider as its source of bytes.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `available()`
  `void`
  `close()`
  `void`
  `mark(int readlimit)`
  `boolean`
  `markSupported()`
  `int`
  `read()`
  `int`
  `read(byte[] b, int bufferOffset, int len)`
  `void`
  `reset()`
  `long`
  `skip(long n)`

  ### Methods inherited from class java.io.InputStream

  `nullInputStream, read, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo`

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

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

- ## Field Details

  - ### provider

    protected ByteProvider provider

- ## Constructor Details

  - ### ByteProviderInputStream

    public ByteProviderInputStream(ByteProvider provider)
    Creates an InputStream that uses a ByteProvider as its source of bytes.
    Parameters:
      `provider` - the `ByteProvider` to wrap

  - ### ByteProviderInputStream

    public ByteProviderInputStream(ByteProvider provider, long startPosition)
    Creates an InputStream that uses a ByteProvider as its source of bytes.
    Parameters:
      `provider` - the `ByteProvider` to wrap
      `startPosition` - starting position in the provider

- ## Method Details

  - ### close

    public void close() throws IOException
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `Closeable`
    Overrides:
      `close` in class `InputStream`
    Throws:
      `IOException`

  - ### available

    public int available() throws IOException
    Overrides:
      `available` in class `InputStream`
    Throws:
      `IOException`

  - ### markSupported

    public boolean markSupported()
    Overrides:
      `markSupported` in class `InputStream`

  - ### mark

    public void mark(int readlimit)
    Overrides:
      `mark` in class `InputStream`

  - ### reset

    public void reset() throws IOException
    Overrides:
      `reset` in class `InputStream`
    Throws:
      `IOException`

  - ### skip

    public long skip(long n) throws IOException
    Overrides:
      `skip` in class `InputStream`
    Throws:
      `IOException`

  - ### read

    public int read() throws IOException
    Specified by:
      `read` in class `InputStream`
    Throws:
      `IOException`

  - ### read

    public int read(byte[] b, int bufferOffset, int len) throws IOException
    Overrides:
      `read` in class `InputStream`
    Throws:
      `IOException`