public final class Base85 extends Object
Modifier and Type | Method and Description |
---|---|
static byte[] |
decode(byte[] encoded,
int expectedSize)
Decodes the Base-85
encoded data into a byte array of
expectedSize bytes. |
static byte[] |
decode(byte[] encoded,
int start,
int length,
int expectedSize)
Decodes
length bytes of Base-85 encoded data, beginning
at the start index, into a byte array of expectedSize
bytes. |
static byte[] |
encode(byte[] data)
Encodes the given
data in Base-85. |
static byte[] |
encode(byte[] data,
int start,
int length)
Encodes
length bytes of data in Base-85, beginning at the
start index. |
static int |
encodedLength(int rawLength)
Determines the length of the base-85 encoding for
rawLength
bytes. |
public static int encodedLength(int rawLength)
rawLength
bytes.rawLength
- number of bytes to encoderawLength
bytespublic static byte[] encode(byte[] data)
data
in Base-85.data
- to encodepublic static byte[] encode(byte[] data, int start, int length)
length
bytes of data
in Base-85, beginning at the
start
index.data
- to encodestart
- index of the first byte to encodelength
- number of bytes to encodepublic static byte[] decode(byte[] encoded, int expectedSize)
encoded
data into a byte array of
expectedSize
bytes.encoded
- Base-85 encoded dataexpectedSize
- of the resultIllegalArgumentException
- if expectedSize doesn't match, the encoded data has a length
that is not a multiple of 5, or there are invalid characters
in the encoded datapublic static byte[] decode(byte[] encoded, int start, int length, int expectedSize)
length
bytes of Base-85 encoded
data, beginning
at the start
index, into a byte array of expectedSize
bytes.encoded
- Base-85 encoded datastart
- index at which the data to decode starts in encoded
length
- of the Base-85 encoded dataexpectedSize
- of the resultIllegalArgumentException
- if expectedSize doesn't match, length
is not a
multiple of 5, or there are invalid characters in the encoded
dataCopyright © 2021 Eclipse JGit Project. All rights reserved.