public class Base64OutputStream extends OutputStream
Provides a mechanism to accept and Base64 encode bytes into chars which will be flushed to the provided writer as the internal buffer fills.
| 构造器和说明 |
|---|
Base64OutputStream(int size,
Writer writer)
Creates a new byte array output stream, with a buffer capacity of
the specified size, in bytes.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close()
Closing Base64OutputStreamWriter does nothing.
|
void |
finish()
Encodes the remaining bytes and flushes the
char[]
to the wrapped Writer. |
int |
getTotalCharsWritten() |
void |
write(byte[] b)
Calls through to
write(byte[], int, int)/ |
void |
write(byte[] b,
int off,
int len)
Writes
len bytes from the specified byte array
starting at offset off to this byte array output stream. |
void |
write(int b)
Writes the specified byte to this byte array output stream.
|
flushpublic Base64OutputStream(int size,
Writer writer)
size - the initial size.writer - the writer we'll flush to once
we reach our capacityIllegalArgumentException - if size is negative.public void write(int b)
throws IOException
write 在类中 OutputStreamb - the byte to be written.IOExceptionpublic void write(byte[] b,
int off,
int len)
throws IOException
len bytes from the specified byte array
starting at offset off to this byte array output stream.write 在类中 OutputStreamb - the data.off - the start offset in the data.len - the number of bytes to write.IOExceptionpublic void write(byte[] b)
throws IOException
Calls through to write(byte[], int, int)/
write 在类中 OutputStreamb - the bytes to writeIOException - if an error occurspublic void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableclose 在类中 OutputStreamIOExceptionpublic void finish()
throws IOException
Encodes the remaining bytes and flushes the char[]
to the wrapped Writer.
IOException - if an error occurs writing the remaining bytespublic int getTotalCharsWritten()
Copyright © 2022–2023. All rights reserved.