Package com.google.common.io
Class BaseEncoding.StandardBaseEncoding
java.lang.Object
com.google.common.io.BaseEncoding
com.google.common.io.BaseEncoding.StandardBaseEncoding
- Direct Known Subclasses:
BaseEncoding.Base16Encoding
,BaseEncoding.Base64Encoding
- Enclosing class:
BaseEncoding
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.common.io.BaseEncoding
BaseEncoding.Alphabet, BaseEncoding.DecodingException, BaseEncoding.SeparatedBaseEncoding
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final BaseEncoding.Alphabet
private BaseEncoding
private BaseEncoding
(package private) final Character
private BaseEncoding
-
Constructor Summary
ConstructorsConstructorDescriptionStandardBaseEncoding
(BaseEncoding.Alphabet alphabet, Character paddingChar) StandardBaseEncoding
(String name, String alphabetChars, Character paddingChar) -
Method Summary
Modifier and TypeMethodDescriptionboolean
canDecode
(CharSequence chars) Determines whether the specified character sequence is a valid encoded string according to this encoding.(package private) int
decodeTo
(byte[] target, CharSequence chars) decodingStream
(Reader reader) Returns anInputStream
that decodes base-encoded input from the specifiedReader
.(package private) void
encodeChunkTo
(Appendable target, byte[] bytes, int off, int len) (package private) void
encodeTo
(Appendable target, byte[] bytes, int off, int len) encodingStream
(Writer out) Returns anOutputStream
that encodes bytes using this encoding into the specifiedWriter
.boolean
int
hashCode()
Returns an encoding that behaves equivalently to this encoding, but decodes letters without regard to case.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, Character paddingChar) 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.toString()
(package private) CharSequence
trimTrailingPadding
(CharSequence chars) Returns an encoding that behaves equivalently to this encoding, but encodes and decodes with uppercase letters.withPadChar
(char padChar) Returns an encoding that behaves equivalently to this encoding, but uses an alternate character for padding.withSeparator
(String separator, int afterEveryChars) Returns an encoding that behaves equivalently to this encoding, but adds a separator string after everyn
characters.Methods inherited from class com.google.common.io.BaseEncoding
base16, base32, base32Hex, base64, base64Url, decode, decodeChecked, decodingSource, encode, encode, encodingSink, ignoringReader, separatingAppendable, separatingWriter
-
Field Details
-
alphabet
-
paddingChar
-
upperCase
-
lowerCase
-
ignoreCase
-
-
Constructor Details
-
StandardBaseEncoding
-
StandardBaseEncoding
StandardBaseEncoding(BaseEncoding.Alphabet alphabet, @CheckForNull Character paddingChar)
-
-
Method Details
-
maxEncodedSize
int maxEncodedSize(int bytes) - Specified by:
maxEncodedSize
in classBaseEncoding
-
encodingStream
Description copied from class:BaseEncoding
Returns anOutputStream
that encodes bytes using this encoding into the specifiedWriter
. When the returnedOutputStream
is closed, so is the backingWriter
.- Specified by:
encodingStream
in classBaseEncoding
-
encodeTo
- Specified by:
encodeTo
in classBaseEncoding
- Throws:
IOException
-
encodeChunkTo
- Throws:
IOException
-
maxDecodedSize
int maxDecodedSize(int chars) - Specified by:
maxDecodedSize
in classBaseEncoding
-
trimTrailingPadding
- Overrides:
trimTrailingPadding
in classBaseEncoding
-
canDecode
Description copied from class:BaseEncoding
Determines whether the specified character sequence is a valid encoded string according to this encoding.- Specified by:
canDecode
in classBaseEncoding
-
decodeTo
- Specified by:
decodeTo
in classBaseEncoding
- Throws:
BaseEncoding.DecodingException
-
decodingStream
Description copied from class:BaseEncoding
Returns anInputStream
that decodes base-encoded input from the specifiedReader
. The returned stream throws aBaseEncoding.DecodingException
upon decoding-specific errors.- Specified by:
decodingStream
in classBaseEncoding
-
omitPadding
Description copied from class:BaseEncoding
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.- Specified by:
omitPadding
in classBaseEncoding
-
withPadChar
Description copied from class:BaseEncoding
Returns an encoding that behaves equivalently to this encoding, but uses an alternate character for padding.- Specified by:
withPadChar
in classBaseEncoding
-
withSeparator
Description copied from class:BaseEncoding
Returns an encoding that behaves equivalently to this encoding, but adds a separator string after everyn
characters. Any occurrences of any characters that occur in the separator are skipped over in decoding.- Specified by:
withSeparator
in classBaseEncoding
-
upperCase
Description copied from class:BaseEncoding
Returns an encoding that behaves equivalently to this encoding, but encodes and decodes with uppercase letters. Padding and separator characters remain in their original case.- Specified by:
upperCase
in classBaseEncoding
-
lowerCase
Description copied from class:BaseEncoding
Returns an encoding that behaves equivalently to this encoding, but encodes and decodes with lowercase letters. Padding and separator characters remain in their original case.- Specified by:
lowerCase
in classBaseEncoding
-
ignoreCase
Description copied from class:BaseEncoding
Returns an encoding that behaves equivalently to this encoding, but decodes letters without regard to case.- Specified by:
ignoreCase
in classBaseEncoding
-
newInstance
-
toString
-
equals
-
hashCode
public int hashCode()
-