Package org.apache.commons.codec.binary
Class BaseNCodec.Context
- java.lang.Object
-
- org.apache.commons.codec.binary.BaseNCodec.Context
-
- Enclosing class:
- BaseNCodec
static class BaseNCodec.Context extends java.lang.Object
Holds thread context so classes can be thread-safe. This class is not itself thread-safe; each thread must allocate its own copy.- Since:
- 1.7
-
-
Field Summary
Fields Modifier and Type Field Description (package private) byte[]
buffer
Buffer for streaming.(package private) int
currentLinePos
Variable tracks how many characters have been written to the current line.(package private) boolean
eof
Boolean flag to indicate the EOF has been reached.(package private) int
ibitWorkArea
Place holder for the bytes we're dealing with for our based logic.(package private) long
lbitWorkArea
Place holder for the bytes we're dealing with for our based logic.(package private) int
modulus
Writes to the buffer only occur after every 3/5 reads when encoding, and every 4/8 reads when decoding.(package private) int
pos
Position where next character should be written in the buffer.(package private) int
readPos
Position where next character should be read from the buffer.
-
Constructor Summary
Constructors Constructor Description Context()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
toString()
Returns a String useful for debugging (especially within a debugger.)
-
-
-
Field Detail
-
ibitWorkArea
int ibitWorkArea
Place holder for the bytes we're dealing with for our based logic. Bitwise operations store and extract the encoding or decoding from this variable.
-
lbitWorkArea
long lbitWorkArea
Place holder for the bytes we're dealing with for our based logic. Bitwise operations store and extract the encoding or decoding from this variable.
-
buffer
byte[] buffer
Buffer for streaming.
-
pos
int pos
Position where next character should be written in the buffer.
-
readPos
int readPos
Position where next character should be read from the buffer.
-
eof
boolean eof
Boolean flag to indicate the EOF has been reached. Once EOF has been reached, this object becomes useless, and must be thrown away.
-
currentLinePos
int currentLinePos
Variable tracks how many characters have been written to the current line. Only used when encoding. We use it to make sure each encoded line never goes beyond lineLength (if lineLength > 0).
-
modulus
int modulus
Writes to the buffer only occur after every 3/5 reads when encoding, and every 4/8 reads when decoding. This variable helps track that.
-
-