public class Base64Encoder extends FilterOutputStream
| 构造器和说明 |
|---|
Base64Encoder(OutputStream out)
Constructs a new Base64 encoder that writes output to the given
OutputStream.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close()
Closes the stream, this MUST be called to ensure proper padding is
written to the end of the output stream.
|
static String |
encode(byte[] bytes)
Returns the encoded form of the given unencoded string.
|
static String |
encode(String unencoded)
Returns the encoded form of the given unencoded string.
|
static void |
main(String[] args)
main
|
void |
write(byte[] buf,
int off,
int len)
Writes the given byte array to the output stream in an encoded form.
|
void |
write(int b)
Writes the given byte to the output stream in an encoded form.
|
flush, writepublic Base64Encoder(OutputStream out)
out - the output streampublic void write(int b)
throws IOException
write 在类中 FilterOutputStreamIOException - if an I/O error occurspublic void write(byte[] buf,
int off,
int len)
throws IOException
write 在类中 FilterOutputStreambuf - the data to be writtenoff - the start offset of the datalen - the length of the dataIOException - if an I/O error occurspublic void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableclose 在类中 FilterOutputStreamIOException - if an I/O error occurspublic static String encode(String unencoded)
unencoded - the string to encode
coded form of the unencoded stringpublic static String encode(byte[] bytes)
bytes - the bytes to encode
the enorm of the unencoded stringCopyright © 2020. All rights reserved.