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
static class BaseEncoding.StandardBaseEncoding extends BaseEncoding
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.common.io.BaseEncoding
BaseEncoding.Base16Encoding, BaseEncoding.Base64Encoding, BaseEncoding.DecodingException, BaseEncoding.SeparatedBaseEncoding, BaseEncoding.StandardBaseEncoding
-
-
Field Summary
Fields Modifier and Type Field Description (package private) BaseEncoding.Alphabetalphabetprivate BaseEncodinglowerCase(package private) java.lang.CharacterpaddingCharprivate BaseEncodingupperCase
-
Constructor Summary
Constructors Constructor Description StandardBaseEncoding(BaseEncoding.Alphabet alphabet, java.lang.Character paddingChar)StandardBaseEncoding(java.lang.String name, java.lang.String alphabetChars, java.lang.Character paddingChar)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanDecode(java.lang.CharSequence chars)Determines whether the specified character sequence is a valid encoded string according to this encoding.(package private) intdecodeTo(byte[] target, java.lang.CharSequence chars)java.io.InputStreamdecodingStream(java.io.Reader reader)Returns anInputStreamthat decodes base-encoded input from the specifiedReader.(package private) voidencodeChunkTo(java.lang.Appendable target, byte[] bytes, int off, int len)(package private) voidencodeTo(java.lang.Appendable target, byte[] bytes, int off, int len)java.io.OutputStreamencodingStream(java.io.Writer out)Returns anOutputStreamthat encodes bytes using this encoding into the specifiedWriter.booleanequals(java.lang.Object other)inthashCode()BaseEncodinglowerCase()Returns an encoding that behaves equivalently to this encoding, but encodes and decodes with lowercase letters.(package private) intmaxDecodedSize(int chars)(package private) intmaxEncodedSize(int bytes)(package private) BaseEncodingnewInstance(BaseEncoding.Alphabet alphabet, java.lang.Character paddingChar)BaseEncodingomitPadding()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.StringtoString()(package private) java.lang.CharSequencetrimTrailingPadding(java.lang.CharSequence chars)BaseEncodingupperCase()Returns an encoding that behaves equivalently to this encoding, but encodes and decodes with uppercase letters.BaseEncodingwithPadChar(char padChar)Returns an encoding that behaves equivalently to this encoding, but uses an alternate character for padding.BaseEncodingwithSeparator(java.lang.String separator, int afterEveryChars)Returns an encoding that behaves equivalently to this encoding, but adds a separator string after everyncharacters.-
Methods inherited from class com.google.common.io.BaseEncoding
base16, base32, base32Hex, base64, base64Url, decode, decodeChecked, decodingSource, encode, encode, encodingSink, ignoringReader, separatingAppendable, separatingWriter
-
-
-
-
Field Detail
-
alphabet
final BaseEncoding.Alphabet alphabet
-
paddingChar
final java.lang.Character paddingChar
-
upperCase
private transient BaseEncoding upperCase
-
lowerCase
private transient BaseEncoding lowerCase
-
-
Constructor Detail
-
StandardBaseEncoding
StandardBaseEncoding(java.lang.String name, java.lang.String alphabetChars, java.lang.Character paddingChar)
-
StandardBaseEncoding
StandardBaseEncoding(BaseEncoding.Alphabet alphabet, java.lang.Character paddingChar)
-
-
Method Detail
-
maxEncodedSize
int maxEncodedSize(int bytes)
- Specified by:
maxEncodedSizein classBaseEncoding
-
encodingStream
@GwtIncompatible public java.io.OutputStream encodingStream(java.io.Writer out)
Description copied from class:BaseEncodingReturns anOutputStreamthat encodes bytes using this encoding into the specifiedWriter. When the returnedOutputStreamis closed, so is the backingWriter.- Specified by:
encodingStreamin classBaseEncoding
-
encodeTo
void encodeTo(java.lang.Appendable target, byte[] bytes, int off, int len) throws java.io.IOException- Specified by:
encodeToin classBaseEncoding- Throws:
java.io.IOException
-
encodeChunkTo
void encodeChunkTo(java.lang.Appendable target, byte[] bytes, int off, int len) throws java.io.IOException- Throws:
java.io.IOException
-
maxDecodedSize
int maxDecodedSize(int chars)
- Specified by:
maxDecodedSizein classBaseEncoding
-
trimTrailingPadding
java.lang.CharSequence trimTrailingPadding(java.lang.CharSequence chars)
- Overrides:
trimTrailingPaddingin classBaseEncoding
-
canDecode
public boolean canDecode(java.lang.CharSequence chars)
Description copied from class:BaseEncodingDetermines whether the specified character sequence is a valid encoded string according to this encoding.- Specified by:
canDecodein classBaseEncoding
-
decodeTo
int decodeTo(byte[] target, java.lang.CharSequence chars) throws BaseEncoding.DecodingException- Specified by:
decodeToin classBaseEncoding- Throws:
BaseEncoding.DecodingException
-
decodingStream
@GwtIncompatible public java.io.InputStream decodingStream(java.io.Reader reader)
Description copied from class:BaseEncodingReturns anInputStreamthat decodes base-encoded input from the specifiedReader. The returned stream throws aBaseEncoding.DecodingExceptionupon decoding-specific errors.- Specified by:
decodingStreamin classBaseEncoding
-
omitPadding
public BaseEncoding omitPadding()
Description copied from class:BaseEncodingReturns 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:
omitPaddingin classBaseEncoding
-
withPadChar
public BaseEncoding withPadChar(char padChar)
Description copied from class:BaseEncodingReturns an encoding that behaves equivalently to this encoding, but uses an alternate character for padding.- Specified by:
withPadCharin classBaseEncoding
-
withSeparator
public BaseEncoding withSeparator(java.lang.String separator, int afterEveryChars)
Description copied from class:BaseEncodingReturns an encoding that behaves equivalently to this encoding, but adds a separator string after everyncharacters. Any occurrences of any characters that occur in the separator are skipped over in decoding.- Specified by:
withSeparatorin classBaseEncoding
-
upperCase
public BaseEncoding upperCase()
Description copied from class:BaseEncodingReturns 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:
upperCasein classBaseEncoding
-
lowerCase
public BaseEncoding lowerCase()
Description copied from class:BaseEncodingReturns 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:
lowerCasein classBaseEncoding
-
newInstance
BaseEncoding newInstance(BaseEncoding.Alphabet alphabet, java.lang.Character paddingChar)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-