Defines common functionality to any parser that works on a java.io.InputStream
Allows you to look up individual bytes by index, take slices of byte ranges or strings, and drop old portions of buffered data once you are certain you no longer need them.
The buffer
size is managed by allowing it to grow in size until it exceeds its capacity. When that happens, one of two things happen:
-
If the buffer has enough space, we left-shift the data in the buffer to over-write the portion that has already been dropped.
-
If the buffer does not have enough space, we allocate a new buffer big enough to hold the new data we need to store (size a power of two multiple of the old size) and copy the data over, again shifted left .
Attributes
- Companion
- object
- Graph
-
- Supertypes
Members list
Value members
Abstract methods
Concrete methods
Inherited methods
Attributes
- Inherited from:
- BufferingByteParser
Attributes
- Inherited from:
- BufferingByteParser
Attributes
- Inherited from:
- BufferingByteParser
Attributes
- Inherited from:
- BufferingByteParser
Attributes
- Inherited from:
- BufferingByteParser
Attributes
- Inherited from:
- BufferingByteParser
Attributes
- Inherited from:
- BufferingByteParser
Attributes
- Inherited from:
- BufferingByteParser
Attributes
- Inherited from:
- BufferingByteParser
Attributes
- Inherited from:
- BufferingByteParser
Copies the non-dropped Bytes in the current buffer to the start of either the current buffer, or a newly-allocated larger buffer if necessary.
Copies the non-dropped Bytes in the current buffer to the start of either the current buffer, or a newly-allocated larger buffer if necessary.
Attributes
- Inherited from:
- BufferingByteParser
Used to ensure that byteents up to until are available to read; returns whether or not we have read off the end of the input.
Used to ensure that byteents up to until are available to read; returns whether or not we have read off the end of the input.
In the fast path, when until is less than the lastIdx we have buffered, there is no work to do and we return false.
In the slow path, when until is more than lastIdx, we then run growBuffer to grow the buffer if necessary, and then readDataIntoBuffer to populate it. readDataIntoBuffer returns a newDone
value to indicate whether we have read off the end of the input or not.
Note that for some subclasses, growBuffer may be a no-op when we already know we have reached the end of input.
Attributes
- Inherited from:
- BufferingByteParser
Used to ask for data up to a certain index, as a best effort (unlike requestUntil), returning the "safe index" which it was actually able to fetch data for. This is used so the caller can use the safe index to know how far it is able to run getByteUnsafe calls without further checks, improving performance over calling getByteSafe every time which performs additional checks and logic
Used to ask for data up to a certain index, as a best effort (unlike requestUntil), returning the "safe index" which it was actually able to fetch data for. This is used so the caller can use the safe index to know how far it is able to run getByteUnsafe calls without further checks, improving performance over calling getByteSafe every time which performs additional checks and logic
Attributes
- Inherited from:
- BufferingByteParser
Attributes
- Inherited from:
- BufferingByteParser
Attributes
- Inherited from:
- BufferingByteParser
Attributes
- Inherited from:
- BufferingByteParser