Hyjack a JavaCharset to drive our code.
Hyjack a JavaCharset to drive our code.
We want to avoid re-implementing all the error handling and flush/end logic.
True if the decoder has not decoded anything since the last reset call.
True if the decoder has not decoded anything since the last reset call. False if decodeLoop has been called.
Use to control things that we only want to check once per reset of the decoder.
Allow assignment to isReset only in derived classes
Allow assignment to isReset only in derived classes
If set, then it means there IS one more byte (at least) at the end of the ByteBuffer which holds the fragment byte.
If set, then it means there IS one more byte (at least) at the end of the ByteBuffer which holds the fragment byte. This final byte is past the limit of the ByteBuffer.
Bit-oriented decoders have to be passed a standard byteBuffer and CharBuffer via the normal Java decodeLoop API.
Bit-oriented decoders have to be passed a standard byteBuffer and CharBuffer via the normal Java decodeLoop API. However, as we are bit oriented, there's the possibility that there is a fragment of a byte at the end, and there can be an offset within the first byte for the start.
So to get that information over to the decoder, given that the decodeLoop API doesn't pass it, we have setters.
So a decoder is stateful. They're always stateful, so this isn't changing that. We're just adding yet more state.
Calling this returns the startBitOffset0b, but also sets flags so that it won't be processed again.
Calling this returns the startBitOffset0b, but also sets flags so that it won't be processed again. It's a once-only thing until a reset.
You have to initialize one of these for a specific ByteBuffer because the encoding is N-bits wide, so we need additional state beyond just the byte position and limit that a ByteBuffer provides in order to properly sequence through the data.