Package ghidra.app.util.bin
Class ByteProviderInputStream
- java.lang.Object
-
- java.io.InputStream
-
- ghidra.app.util.bin.ByteProviderInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
- Direct Known Subclasses:
ByteProviderInputStream.ClosingInputStream
public class ByteProviderInputStream extends java.io.InputStreamAnInputStreamthat reads from aByteProvider.Does not close the underlying ByteProvider when closed itself.
-
-
Nested Class Summary
Nested Classes Change Modifier and Type Class Description static classByteProviderInputStream.ClosingInputStreamAnInputStreamthat reads from aByteProvider, and DOESclose()the underlying ByteProvider when closed itself.
-
Field Summary
Fields Change Modifier and Type Field Description protected ByteProviderprovider
-
Constructor Summary
Constructors Change 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
All Methods Instance Methods Concrete Methods Change Modifier and Type Method Description NEW intavailable()NEW voidclose()NEW voidmark(int readlimit)NEW booleanmarkSupported()intread()intread(byte[] b, int bufferOffset, int len)NEW voidreset()NEW longskip(long n)
-
-
-
Field Detail
-
provider
protected ByteProvider provider
-
-
Constructor Detail
-
ByteProviderInputStream
public ByteProviderInputStream(ByteProvider provider)
Creates an InputStream that uses a ByteProvider as its source of bytes.- Parameters:
provider- theByteProviderto wrap
-
ByteProviderInputStream
public ByteProviderInputStream(ByteProvider provider, long startPosition)
Creates an InputStream that uses a ByteProvider as its source of bytes.- Parameters:
provider- theByteProviderto wrapstartPosition- starting position in the provider
-
-
Method Detail
-
close NEW
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.InputStream- Throws:
java.io.IOException
-
available NEW
public int available() throws java.io.IOException- Overrides:
availablein classjava.io.InputStream- Throws:
java.io.IOException
-
markSupported NEW
public boolean markSupported()
- Overrides:
markSupportedin classjava.io.InputStream
-
reset NEW
public void reset() throws java.io.IOException- Overrides:
resetin classjava.io.InputStream- Throws:
java.io.IOException
-
skip NEW
public long skip(long n) throws java.io.IOException- Overrides:
skipin classjava.io.InputStream- Throws:
java.io.IOException
-
read
public int read() throws java.io.IOException- Specified by:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
-