Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| xmlgraphics-commons 1.5
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.xmlgraphics.util.io
Class Base64DecodeStream

    java.lang.Object
      java.io.InputStream
          org.apache.xmlgraphics.util.io.Base64DecodeStream

All Implemented Interfaces:
  Closeable

    public class Base64DecodeStream

extends InputStream

This class implements a Base64 Character decoder as specified in RFC1113. Unlike some other encoding schemes there is nothing in this encoding that tells the decoder where a buffer starts or stops, so to use it you will need to isolate your encoded data into a single chunk and then feed them this decoder. The simplest way to do that is to read all of the encoded data into a string and then use:

          byte    data[];
          InputStream is = new ByteArrayInputStream(data);
          is = new Base64DecodeStream(is);

On errors, this class throws a IOException with the following detail strings:

        "Base64DecodeStream: Bad Padding byte (2)."
        "Base64DecodeStream: Bad Padding byte (1)."

Version:
  $Id: Base64DecodeStream.java 1345683 2012-06-03 14:50:33Z gadams $ Originally authored by Thomas DeWeese, Vincent Hardy, and Chuck McManis.

Constructor Summary
`Base64DecodeStream(InputStream src)`

Method Summary
`int` | `available()`
`void` | `close()`
`boolean` | `markSupported()`
`int` | `read()`
`int` | `read(byte[] out, int offset, int len)`

Methods inherited from class java.io.InputStream
`mark, read, reset, skip`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Base64DecodeStream

    public Base64DecodeStream(InputStream src)

Method Detail

### markSupported

    public boolean markSupported()

  Overrides:
    `markSupported` in class `InputStream`

### close

    public void close()
               throws IOException

  Specified by:
    `close` in interface `Closeable`
  Overrides:
    `close` in class `InputStream`
  Throws:
    `IOException`

### available

    public int available()
                  throws IOException

  Overrides:
    `available` in class `InputStream`
  Throws:
    `IOException`

### read

    public int read()
             throws IOException

  Specified by:
    `read` in class `InputStream`
  Throws:
    `IOException`

### read

    public int read(byte[] out,
                    int offset,
                    int len)
             throws IOException

  Overrides:
    `read` in class `InputStream`
  Throws:
    `IOException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| xmlgraphics-commons 1.5
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 1999-2012 The Apache Software Foundation. All Rights Reserved.