public class BufferedBase64OutputStream extends FilterOutputStream
Note that the endBase64()
method should be called
once at the end of writing to flush the input and ensure that
the output is ended correctly.
Closing the stream will call this if it has not been called already.
out
Constructor and Description |
---|
BufferedBase64OutputStream(OutputStream out)
Constructor with default characteristics.
|
BufferedBase64OutputStream(OutputStream out,
int quadsPerLine,
byte[] lineEnd,
int linesPerBuf)
Custom constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Calls
endBase64() if required before closing. |
void |
endBase64()
Flushes any data in the buffer and terminates the Base64 output
correctly.
|
void |
flush()
This calls flush on the underlying stream, but does not
flush this stream itself.
|
int |
getOutputBufferSize()
Returns the size of the output buffer; output will be written to
the underlying stream in chunks of this size.
|
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
public BufferedBase64OutputStream(OutputStream out)
out
- underlying output stream, doesn't need to be bufferedpublic BufferedBase64OutputStream(OutputStream out, int quadsPerLine, byte[] lineEnd, int linesPerBuf)
out
- underlying output stream, doesn't need to be bufferedquadsPerLine
- number of 4-byte groups per output linelineEnd
- sequence of bytes to be written after each output linelinesPerBuf
- number of lines buffered before an actual write
to the underlying stream is performedpublic void write(int b) throws IOException
write
in class FilterOutputStream
IOException
public void write(byte[] b, int off, int len) throws IOException
write
in class FilterOutputStream
IOException
public void write(byte[] b) throws IOException
write
in class FilterOutputStream
IOException
public void endBase64() throws IOException
close()
if it has not been done already.
The effect of further writes to this stream following a call
to this method is undefined.IOException
public int getOutputBufferSize()
public void flush() throws IOException
endBase64()
method must be called to do that.flush
in interface Flushable
flush
in class FilterOutputStream
IOException
public void close() throws IOException
endBase64()
if required before closing.close
in interface Closeable
close
in interface AutoCloseable
close
in class FilterOutputStream
IOException
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.