static class BaseEncoding.StandardBaseEncoding extends BaseEncoding
BaseEncoding.Base16Encoding, BaseEncoding.Base64Encoding, BaseEncoding.DecodingException, BaseEncoding.SeparatedBaseEncoding, BaseEncoding.StandardBaseEncoding
Modifier and Type | Field and Description |
---|---|
(package private) BaseEncoding.Alphabet |
alphabet |
private BaseEncoding |
lowerCase |
(package private) java.lang.Character |
paddingChar |
private BaseEncoding |
upperCase |
Constructor and Description |
---|
StandardBaseEncoding(BaseEncoding.Alphabet alphabet,
java.lang.Character paddingChar) |
StandardBaseEncoding(java.lang.String name,
java.lang.String alphabetChars,
java.lang.Character paddingChar) |
Modifier and Type | Method and Description |
---|---|
boolean |
canDecode(java.lang.CharSequence chars)
Determines whether the specified character sequence is a valid encoded string according to this
encoding.
|
(package private) int |
decodeTo(byte[] target,
java.lang.CharSequence chars) |
java.io.InputStream |
decodingStream(java.io.Reader reader)
Returns an
InputStream that decodes base-encoded input from the specified Reader . |
(package private) void |
encodeChunkTo(java.lang.Appendable target,
byte[] bytes,
int off,
int len) |
(package private) void |
encodeTo(java.lang.Appendable target,
byte[] bytes,
int off,
int len) |
java.io.OutputStream |
encodingStream(java.io.Writer out)
Returns an
OutputStream that encodes bytes using this encoding into the specified
Writer . |
boolean |
equals(java.lang.Object other) |
int |
hashCode() |
BaseEncoding |
lowerCase()
Returns an encoding that behaves equivalently to this encoding, but encodes and decodes with
lowercase letters.
|
(package private) int |
maxDecodedSize(int chars) |
(package private) int |
maxEncodedSize(int bytes) |
(package private) BaseEncoding |
newInstance(BaseEncoding.Alphabet alphabet,
java.lang.Character paddingChar) |
BaseEncoding |
omitPadding()
Returns an encoding that behaves equivalently to this encoding, but omits any padding
characters as specified by RFC 4648
section 3.2, Padding of Encoded Data.
|
java.lang.String |
toString() |
(package private) java.lang.CharSequence |
trimTrailingPadding(java.lang.CharSequence chars) |
BaseEncoding |
upperCase()
Returns an encoding that behaves equivalently to this encoding, but encodes and decodes with
uppercase letters.
|
BaseEncoding |
withPadChar(char padChar)
Returns an encoding that behaves equivalently to this encoding, but uses an alternate character
for padding.
|
BaseEncoding |
withSeparator(java.lang.String separator,
int afterEveryChars)
Returns an encoding that behaves equivalently to this encoding, but adds a separator string
after every
n characters. |
base16, base32, base32Hex, base64, base64Url, decode, decodeChecked, decodingSource, encode, encode, encodingSink, ignoringReader, separatingAppendable, separatingWriter
final BaseEncoding.Alphabet alphabet
final java.lang.Character paddingChar
private transient BaseEncoding upperCase
private transient BaseEncoding lowerCase
StandardBaseEncoding(java.lang.String name, java.lang.String alphabetChars, java.lang.Character paddingChar)
StandardBaseEncoding(BaseEncoding.Alphabet alphabet, java.lang.Character paddingChar)
int maxEncodedSize(int bytes)
maxEncodedSize
in class BaseEncoding
@GwtIncompatible public java.io.OutputStream encodingStream(java.io.Writer out)
BaseEncoding
OutputStream
that encodes bytes using this encoding into the specified
Writer
. When the returned OutputStream
is closed, so is the backing Writer
.encodingStream
in class BaseEncoding
void encodeTo(java.lang.Appendable target, byte[] bytes, int off, int len) throws java.io.IOException
encodeTo
in class BaseEncoding
java.io.IOException
void encodeChunkTo(java.lang.Appendable target, byte[] bytes, int off, int len) throws java.io.IOException
java.io.IOException
int maxDecodedSize(int chars)
maxDecodedSize
in class BaseEncoding
java.lang.CharSequence trimTrailingPadding(java.lang.CharSequence chars)
trimTrailingPadding
in class BaseEncoding
public boolean canDecode(java.lang.CharSequence chars)
BaseEncoding
canDecode
in class BaseEncoding
int decodeTo(byte[] target, java.lang.CharSequence chars) throws BaseEncoding.DecodingException
decodeTo
in class BaseEncoding
BaseEncoding.DecodingException
@GwtIncompatible public java.io.InputStream decodingStream(java.io.Reader reader)
BaseEncoding
InputStream
that decodes base-encoded input from the specified Reader
. The returned stream throws a BaseEncoding.DecodingException
upon decoding-specific errors.decodingStream
in class BaseEncoding
public BaseEncoding omitPadding()
BaseEncoding
omitPadding
in class BaseEncoding
public BaseEncoding withPadChar(char padChar)
BaseEncoding
withPadChar
in class BaseEncoding
public BaseEncoding withSeparator(java.lang.String separator, int afterEveryChars)
BaseEncoding
n
characters. Any occurrences of any characters that occur in the separator
are skipped over in decoding.withSeparator
in class BaseEncoding
public BaseEncoding upperCase()
BaseEncoding
upperCase
in class BaseEncoding
public BaseEncoding lowerCase()
BaseEncoding
lowerCase
in class BaseEncoding
BaseEncoding newInstance(BaseEncoding.Alphabet alphabet, java.lang.Character paddingChar)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object