Package ghidra.app.decompiler
Class LimitedByteBuffer
- java.lang.Object
-
- ghidra.app.decompiler.LimitedByteBuffer
-
public class LimitedByteBuffer extends java.lang.Object
Class for accumulating bytes into an automatically expanding buffer with an explicit upper limit to the size
-
-
Constructor Summary
Constructors Constructor Description LimitedByteBuffer(int initial, int amax)
Create the buffer specifying its initial and limiting capacity
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
append(byte b)
Append a byte into the buffer.java.io.ByteArrayInputStream
getInputStream()
Generate an InputStream from the bytes that have been appended to the buffer The buffer is NOT copiedjava.lang.String
toString()
-
-
-
Constructor Detail
-
LimitedByteBuffer
public LimitedByteBuffer(int initial, int amax)
Create the buffer specifying its initial and limiting capacity- Parameters:
initial
- is the number of bytes to be initially allocated for the bufferamax
- is the absolute maximum number of bytes the buffer is allowed to expand to before throwing exceptions
-
-
Method Detail
-
append
public void append(byte b) throws java.io.IOException
Append a byte into the buffer. The buffer's internal storage is expanded as necessary, but only up to the specified maximum. If this append exceeds that maximum, then an exception is thrown- Parameters:
b
- is the byte to append- Throws:
java.io.IOException
-
getInputStream
public java.io.ByteArrayInputStream getInputStream()
Generate an InputStream from the bytes that have been appended to the buffer The buffer is NOT copied- Returns:
- the new InputStream
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-