Closeable
, Flushable
, AutoCloseable
public class Base64FilterOutputStream extends AbstractEncodingFilterOutputStream
Modifier and Type | Field | Description |
---|---|---|
static int |
LINE_LENGTH_64 |
Wrap lines at 64 characters.
|
static int |
LINE_LENGTH_76 |
Wrap lines at 76 characters.
|
static char |
LINE_TERMINATOR |
Line termination character.
|
out
Constructor | Description |
---|---|
Base64FilterOutputStream(OutputStream out) |
Creates a base-64 filter output stream around the given output stream.
|
Base64FilterOutputStream(OutputStream out,
int charsPerLine) |
/** Creates a base-64 filter output stream around the given output
stream.
|
Modifier and Type | Method | Description |
---|---|---|
void |
close() |
|
protected void |
flushToStream() |
Encodes the contents of the write buffer and writes the result to the
wrapped output stream.
|
protected void |
writeEncoded(byte[] data,
int offset,
int length) |
Encode the given raw bytes and write the result to the wrapped output
stream.
|
write, write, write
flush
public static final int LINE_LENGTH_64
public static final int LINE_LENGTH_76
public static final char LINE_TERMINATOR
public Base64FilterOutputStream(OutputStream out)
out
- Output stream to wrap.public Base64FilterOutputStream(OutputStream out, int charsPerLine)
out
- Output stream to wrap.charsPerLine
- Number of characters per line of encoded output. Must
be one of LINE_LENGTH_64
, LINE_LENGTH_76
, or 0
to indicate no wrapping.public void close() throws IOException
close
in interface AutoCloseable
close
in interface Closeable
close
in class FilterOutputStream
IOException
protected void writeEncoded(byte[] data, int offset, int length) throws IOException
writeEncoded
in class AbstractEncodingFilterOutputStream
data
- Raw bytes to be encoded and written.offset
- Starting index of data to be written in input byte array.length
- Number of bytes to be written from input byte array.IOException
- On write errors.protected void flushToStream() throws IOException
IOException
- On write errors.Copyright © 2021. All rights reserved.