Package ghidra.program.model.mem
Class MemBufferInputStream
java.lang.Object
java.io.InputStream
ghidra.program.model.mem.MemBufferInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
Adapter between
membuffers
and inputstreams
.-
Constructor Summary
ConstructorDescriptionMemBufferInputStream
(MemBuffer membuf) Creates a new instance, starting a offset 0 of the membuffer, limited to the first 2Gb of the membuffer.MemBufferInputStream
(MemBuffer membuf, int initialPosition, int length) Creates a new instance ofMemBufferInputStream
, starting at the specified offset, limited to the firstlength
bytes. -
Method Summary
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Constructor Details
-
MemBufferInputStream
Creates a new instance, starting a offset 0 of the membuffer, limited to the first 2Gb of the membuffer.- Parameters:
membuf
-MemBuffer
to wrap as an inputstream
-
MemBufferInputStream
Creates a new instance ofMemBufferInputStream
, starting at the specified offset, limited to the firstlength
bytes.- Parameters:
membuf
-MemBuffer
to wrap as an inputstreaminitialPosition
- starting position in the membufferlength
- number of bytes to limit this inputstream to. The sum ofinitialPosition
andlength
must not exceedInteger.MAX_VALUE
+1
-
-
Method Details
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
available
- Overrides:
available
in classInputStream
- Throws:
IOException
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-