Top Description Fields Constructors Methods
org.bouncycastle.util.encoders

public Class Base32

extends Object
Class Inheritance
Imports
java.io.ByteArrayOutputStream, .IOException, .OutputStream, org.bouncycastle.util.Strings

Utility class for converting Base32 data to bytes and back again.

Field Summary

Modifier and TypeField and Description
private static final Encoder

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static byte[]

Returns:

a byte array representing the decoded data.
decode
(byte[] data)

decode the base 32 encoded input data.

public static byte[]

Returns:

a byte array representing the decoded data.
decode
(String data)

decode the base 32 encoded String data - whitespace will be ignored.

public static int

Returns:

the number of bytes produced.
decode
(String data, OutputStream out)

decode the base 32 encoded String data writing it to the given output stream, whitespace characters will be ignored.

public static int
decode(byte[]
The source data.
base32Data
,
int
Start position.
start
,
int
the length.
length
,
OutputStream
The output stream to write to.
out
)

Decode to an output stream;

public static byte[]

Returns:

a byte array containing the base 32 encoded data.
encode
(byte[] data)

encode the input data producing a base 32 encoded byte array.

public static byte[]

Returns:

a byte array containing the base 32 encoded data.
encode
(byte[] data, int off, int length)

encode the input data producing a base 32 encoded byte array.

public static int

Returns:

the number of bytes produced.
encode
(byte[] data, OutputStream out)

Encode the byte data to base 32 writing it to the given output stream.

public static int

Returns:

the number of bytes produced.
encode
(byte[] data, int off, int length, OutputStream out)

Encode the byte data to base 32 writing it to the given output stream.

public static String
toBase32String(byte[] data)

public static String
toBase32String(byte[] data, int off, int length)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

encoderback to summary
private static final Encoder encoder

Constructor Detail

Base32back to summary
public Base32()

Method Detail

decodeback to summary
public static byte[] decode(byte[] data)

decode the base 32 encoded input data. It is assumed the input data is valid.

Returns:byte[]

a byte array representing the decoded data.

decodeback to summary
public static byte[] decode(String data)

decode the base 32 encoded String data - whitespace will be ignored.

Returns:byte[]

a byte array representing the decoded data.

decodeback to summary
public static int decode(String data, OutputStream out) throws IOException

decode the base 32 encoded String data writing it to the given output stream, whitespace characters will be ignored.

Returns:int

the number of bytes produced.

decodeback to summary
public static int decode(byte[] base32Data, int start, int length, OutputStream out)

Decode to an output stream;

Parameters
base32Data:byte[]

The source data.

start:int

Start position.

length:int

the length.

out:OutputStream

The output stream to write to.

encodeback to summary
public static byte[] encode(byte[] data)

encode the input data producing a base 32 encoded byte array.

Returns:byte[]

a byte array containing the base 32 encoded data.

encodeback to summary
public static byte[] encode(byte[] data, int off, int length)

encode the input data producing a base 32 encoded byte array.

Returns:byte[]

a byte array containing the base 32 encoded data.

encodeback to summary
public static int encode(byte[] data, OutputStream out) throws IOException

Encode the byte data to base 32 writing it to the given output stream.

Returns:int

the number of bytes produced.

encodeback to summary
public static int encode(byte[] data, int off, int length, OutputStream out) throws IOException

Encode the byte data to base 32 writing it to the given output stream.

Returns:int

the number of bytes produced.

toBase32Stringback to summary
public static String toBase32String(byte[] data)
toBase32Stringback to summary
public static String toBase32String(byte[] data, int off, int length)