public class Base32Codec extends Object implements IByteArrayCodec
| Constructor and Description |
|---|
Base32Codec()
Creates a Base32 codec used for decoding and encoding.
|
Base32Codec(boolean bUseHex)
Creates a Base32 codec used for decoding and encoding.
|
| Modifier and Type | Method and Description |
|---|---|
void |
decode(byte[] aEncodedBuffer,
int nOfs,
int nLen,
OutputStream aOS)
Decode (part of) a byte array.
|
void |
encode(byte[] aDecodedBuffer,
int nOfs,
int nLen,
OutputStream aOS)
Encode (part of) a byte array to an
OutputStream. |
int |
getDecodedLength(int nLen) |
int |
getEncodedLength(int nLen) |
byte |
getPad() |
boolean |
isAddPadding() |
boolean |
isHexEncoding() |
Base32Codec |
setAddPaddding(boolean bAddPadding) |
Base32Codec |
setPad(byte nPad) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdecode, getDecoded, getDecodedAsString, getDecodedAsString, getDecodedAsStringgetDecoded, getDecodedencode, getEncoded, getEncoded, getEncoded, getEncodedAsString, getEncodedAsString, getEncodedAsStringpublic Base32Codec()
public Base32Codec(boolean bUseHex)
bUseHex - true to use hex encoding, false to use
regular encoding.public boolean isHexEncoding()
public byte getPad()
@Nonnull public Base32Codec setPad(byte nPad)
public boolean isAddPadding()
@Nonnull public Base32Codec setAddPaddding(boolean bAddPadding)
public int getEncodedLength(int nLen)
getEncodedLength in interface IByteArrayEncodergetEncodedLength in interface IByteArrayStreamEncoderpublic void encode(@Nullable byte[] aDecodedBuffer, @Nonnegative int nOfs, @Nonnegative int nLen, @Nonnull @WillNotClose OutputStream aOS)
IByteArrayStreamEncoderOutputStream.encode in interface IByteArrayStreamEncoderaDecodedBuffer - The byte array to be encoded. May be null.nOfs - Offset into the byte array to start from.nLen - Number of bytes starting from offset to consider.aOS - The output stream to write to. May not be null and is
NOT closed afterwards!public int getDecodedLength(int nLen)
getDecodedLength in interface IByteArrayDecoderpublic void decode(@Nullable byte[] aEncodedBuffer, @Nonnegative int nOfs, @Nonnegative int nLen, @Nonnull @WillNotClose OutputStream aOS)
IByteArrayStreamDecoderdecode in interface IByteArrayStreamDecoderaEncodedBuffer - The byte array to be decoded. May be null.nOfs - Offset into the byte array to start from.nLen - Number of bytes starting from offset to consider.aOS - The output stream to write to. May not be null and is
NOT closed afterwards!Copyright © 2014–2017 Philip Helger. All rights reserved.