public static class

Base64Harder.InputStream

extends FilterInputStream
java.lang.Object
   ↳ java.io.InputStream
     ↳ java.io.FilterInputStream
       ↳ com.microstrategy.utils.Base64Harder.InputStream

Class Overview

A Base64Harder.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
Base64Harder.InputStream(InputStream in)
Constructs a Base64Harder.InputStream in DECODE mode.
Base64Harder.InputStream(InputStream in, int options)
Constructs a Base64Harder.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 Base64Harder.InputStream (InputStream in)

Constructs a Base64Harder.InputStream in DECODE mode.

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

public Base64Harder.InputStream (InputStream in, int options)

Constructs a Base64Harder.InputStream in either ENCODE or DECODE mode.

Valid options:

   ENCODE or DECODE: Encode or Decode as data is read.
   DONT_BREAK_LINES: don't break lines at 76 characters
     (only meaningful when encoding)
     Note: Technically, this makes your encoding non-compliant.
 

Example: new Base64Harder.InputStream( in, Base64Harder.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