public static class

Base64.InputStream

extends FilterInputStream
java.lang.Object
   ↳ java.io.InputStream
     ↳ java.io.FilterInputStream
       ↳ com.pnfsoftware.jeb.util.encoding.Base64.InputStream

Class Overview

A Base64.InputStream will read data from another java.io.InputStream, given in the constructor, and encode/decode to/from Base64 notation on the fly.

See Also

Summary

[Expand]
Inherited Fields
From class java.io.FilterInputStream
Public Constructors
InputStream(InputStream in)
Constructs a Base64.InputStream in DECODE mode.
InputStream(InputStream in, int options)
Constructs a Base64.InputStream in either ENCODE or DECODE mode.
Public Methods
int read()
Reads enough of the input stream to convert to/from Base64 and returns the next byte.
int read(byte[] dest, int off, int len)
Calls read() repeatedly until the end of stream is reached or len bytes are read.
[Expand]
Inherited Methods
From class java.io.FilterInputStream
From class java.io.InputStream
From class java.lang.Object
From interface java.io.Closeable
From interface java.lang.AutoCloseable

Public Constructors

public InputStream (InputStream in)

Constructs a Base64.InputStream in DECODE mode.

Parameters
in the java.io.InputStream from which to read data.

public InputStream (InputStream in, int options)

Constructs a Base64.InputStream 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 )

Parameters
in the java.io.InputStream from which to read data.
options Specified options

Public Methods

public int read ()

Reads enough of the input stream to convert to/from Base64 and returns the next byte.

Returns
  • next byte
Throws
IOException

public int read (byte[] dest, int off, int len)

Calls 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.

Parameters
dest array to hold values
off offset for array
len max number of bytes to read into array
Returns
  • bytes read into array or -1 if end of stream is encountered.
Throws
IOException