public static class

Base64.InputStream

extends FilterInputStream
java.lang.Object
   ↳ java.io.InputStream
     ↳ java.io.FilterInputStream
       ↳ net.schmizz.sshj.common.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 Constants
From class java.io.InputStream
Fields
private final boolean breakLines
private final byte[] buffer
private final int bufferLength
private final byte[] decodabet
private final boolean encode
private int lineLength
private int numSigBytes
private final int options
private int position
[Expand]
Inherited Fields
From class java.io.FilterInputStream
Public Constructors
Base64.InputStream(InputStream in)
Constructs a Base64.InputStream in DECODE mode.
Base64.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

Fields

private final boolean breakLines

private final byte[] buffer

private final int bufferLength

private final byte[] decodabet

private final boolean encode

private int lineLength

private int numSigBytes

private final int options

private int position

Public Constructors

public Base64.InputStream (InputStream in)

Constructs a Base64.InputStream in DECODE mode.

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

public Base64.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)</i>
 

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