@NotThreadSafe public class Base64InputStream extends WrappedInputStream
Base64InputStream will read data from another
InputStream, given in the constructor, and encode/decode to/from
Base64 notation on the fly.Base64in| Constructor and Description |
|---|
Base64InputStream(InputStream pin)
Constructs a
Base64InputStream in DECODE mode. |
Base64InputStream(InputStream aIS,
int nOptions)
Constructs a
Base64InputStream in either ENCODE or DECODE mode. |
| Modifier and Type | Method and Description |
|---|---|
int |
read()
Reads enough of the input stream to convert to/from Base64 and returns the
next byte.
|
int |
read(byte[] aDest,
int nOfs,
int nLen)
Calls
read() repeatedly until the end of stream is reached or
len bytes are read. |
getWrappedInputStream, toStringavailable, close, mark, markSupported, read, reset, skippublic Base64InputStream(@Nonnull InputStream pin)
Base64InputStream in DECODE mode.pin - the InputStream from which to read data.public Base64InputStream(@Nonnull InputStream aIS, int nOptions)
Base64InputStream in either ENCODE or DECODE mode.
Valid options:
ENCODE or DECODE: Encode or Decode as data is read.
DO_BREAK_LINES: break lines at 76 characters
(only meaningful when encoding)
Example: new Base64.InputStream( in, Base64.DECODE )
aIS - the InputStream from which to read data.nOptions - Specified optionsBase64.ENCODE,
Base64.DECODE,
Base64.DO_BREAK_LINESpublic int read()
throws IOException
read in class FilterInputStreamIOExceptionpublic int read(@Nonnull byte[] aDest, @Nonnegative int nOfs, @Nonnegative int nLen) throws IOException
read() repeatedly until the end of stream is reached or
len bytes are read. Returns number of bytes read into array or -1
if end of stream is encountered.read in class FilterInputStreamaDest - array to hold valuesnOfs - offset for arraynLen - max number of bytes to read into arrayIOExceptionCopyright © 2014–2019 Philip Helger. All rights reserved.