Package ghidra.program.model.pcode
Class StringIngest
java.lang.Object
ghidra.program.model.pcode.StringIngest
- All Implemented Interfaces:
ByteIngest
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear any previous cached bytes.voidFormal indicator that ingesting of bytes is complete and processing can beginvoidingestBytes(byte[] byteArray, int off, int sz) Ingest bytes directly from a byte array.voidingestStream(InputStream inStream) Ingest bytes from the stream until the end of stream is encountered.voidingestStreamToNextTerminator(InputStream inStream) Ingest bytes from the stream up to (and including) the first 0 byte.booleanisEmpty()voidOpen the ingester for receiving bytes.toString()
-
Constructor Details
-
StringIngest
public StringIngest()
-
-
Method Details
-
open
Description copied from interface:ByteIngestOpen the ingester for receiving bytes. This establishes the description of the source of the bytes and maximum number of bytes that can be read- Specified by:
openin interfaceByteIngest- Parameters:
max- is the maximum number of bytes that can be readdesc- is the description of the byte source
-
ingestStreamToNextTerminator
Description copied from interface:ByteIngestIngest bytes from the stream up to (and including) the first 0 byte. This can be called multiple times to read in bytes in different chunks. An absolute limit is set on the number of bytes that can be ingested via the max parameter to a previous call to open(). If this limit is exceeded, an exception is thrown.- Specified by:
ingestStreamToNextTerminatorin interfaceByteIngest- Parameters:
inStream- is the input stream to read from- Throws:
IOException- for errors reading from the stream
-
ingestStream
Description copied from interface:ByteIngestIngest bytes from the stream until the end of stream is encountered. An absolute limit is set on the number of bytes that can be ingested via the max parameter to a previous call to open(). If this limit is exceeded, an exception is thrown.- Specified by:
ingestStreamin interfaceByteIngest- Parameters:
inStream- is the input stream to read from- Throws:
IOException- for errors reading from the stream
-
ingestBytes
Description copied from interface:ByteIngestIngest bytes directly from a byte array. If these bytes would cause the total number of bytes ingested to exceed the maximum (as set by the call to open()), an exception is thrown. This can be called multiple times to read in different chunks.- Specified by:
ingestBytesin interfaceByteIngest- Parameters:
byteArray- is the array of bytesoff- is the index of the first byte to ingestsz- is the number of bytes to ingest- Throws:
IOException- if the max number of bytes to ingest is exceeded
-
endIngest
public void endIngest()Description copied from interface:ByteIngestFormal indicator that ingesting of bytes is complete and processing can begin- Specified by:
endIngestin interfaceByteIngest
-
clear
public void clear()Description copied from interface:ByteIngestClear any previous cached bytes.- Specified by:
clearin interfaceByteIngest
-
toString
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceByteIngest- Returns:
- true if no bytes have yet been ingested via ingestStream()
-