public abstract static class Base64.Encoder
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private char[] |
charBuffer |
private int |
charOffset |
private int |
lineChars |
private int |
num |
private int |
numBytes |
private java.lang.String |
sep |
private int |
skipChars |
private int |
wrapSize |
| Modifier | Constructor and Description |
|---|---|
protected |
Encoder(char[] pBuffer,
int pWrapSize,
java.lang.String pSep)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
flush()
Writes any currently buffered data to the destination.
|
private void |
wrap() |
void |
write(byte[] pBuffer,
int pOffset,
int pLen)
Encodes the given byte array.
|
protected abstract void |
writeBuffer(char[] pChars,
int pOffset,
int pLen)
Called for writing the buffer contents to the target.
|
private int num
private int numBytes
private final char[] charBuffer
private int charOffset
private final int wrapSize
private final int skipChars
private final java.lang.String sep
private int lineChars
protected Encoder(char[] pBuffer,
int pWrapSize,
java.lang.String pSep)
pBuffer - The encoders buffer. The encoder will
write to the buffer as long as possible. If the
buffer is full or the end of data is signaled, then
the method writeBuffer(char[], int, int)
will be invoked.pWrapSize - A nonzero value indicates, that a line
wrap should be performed after the given number of
characters. The value must be a multiple of 4. Zero
indicates, that no line wrap should be performed.pSep - The eol sequence being used to terminate
a line in case of line wraps. May be null, in which
case the default value Base64.LINE_SEPARATOR
is being used.protected abstract void writeBuffer(char[] pChars,
int pOffset,
int pLen)
throws java.io.IOException
pChars - The buffer being written.pOffset - Offset of first character being written.pLen - Number of characters being written.java.io.IOException - Writing to the destination failed.private void wrap()
public void write(byte[] pBuffer,
int pOffset,
int pLen)
throws java.io.IOException
pBuffer - Byte array being encoded.pOffset - Offset of first byte being encoded.pLen - Number of bytes being encoded.java.io.IOException - Invoking the writeBuffer(char[],int,int) method
for writing the encoded data failed.public void flush()
throws java.io.IOException
java.io.IOException - Invoking the writeBuffer(char[],int,int)
method for writing the encoded data failed.