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 Modifier and Type Class Description static classByteProviderInputStream.ClosingInputStreamAnInputStreamthat reads from aByteProvider, and DOESclose()the underlying ByteProvider when closed itself.
-
Field Summary
Fields Modifier and Type Field Description protected ByteProviderprovider
-
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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidclose()voidmark(int readlimit)booleanmarkSupported()intread()intread(byte[] b, int bufferOffset, int len)voidreset()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
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
public int available() throws java.io.IOException- Overrides:
availablein classjava.io.InputStream- Throws:
java.io.IOException
-
markSupported
public boolean markSupported()
- Overrides:
markSupportedin classjava.io.InputStream
-
mark
public void mark(int readlimit)
- Overrides:
markin classjava.io.InputStream
-
reset
public void reset() throws java.io.IOException- Overrides:
resetin classjava.io.InputStream- Throws:
java.io.IOException
-
skip
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
-
read
public int read(byte[] b, int bufferOffset, int len) throws java.io.IOException- Overrides:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
-