java.lang.Object
i2p.susi.webmail.encoding.Encoding
i2p.susi.webmail.encoding.SevenBit
Decode only.
Field Summary
Constructor Summary
ConstructorsConstructorDescriptionSevenBit()A bare instance is ready to decode; the only inherited state is the logger that Encoding's constructor sets up from the global context.Method Summary
All MethodsModifier and TypeMethodDescriptiondecode(byte[] in, int offset, int length) Pass the bytes through after checking they are 7-bit.We don't do any 8-bit checks like we do for decode(byte[]).voiddecode(InputStream in, Buffer out) Copy in to out, unchanged We don't do any 8-bit checks like we do for decode(byte[]).encode(byte[] in) Verify the bytes are 7-bit clean and return them as text.getName()Returns the name of this encoding.Methods inherited from class Encoding
decode, decode, decode, encode, encodeModifier and TypeMethodDescriptiondecode(byte[] in) Decode a byte array using default offset and length.voidDecode a buffer into another buffer using the input stream.Decode a string.voidencode(InputStream in, Writer out) Encode an input stream of bytes to a ASCII or ISO-8859-1 String.Encode a (UTF-8) String to a ASCII or ISO-8859-1 String.
Constructor Details
SevenBit
public SevenBit()A bare instance is ready to decode; the only inherited state is the logger that Encoding's constructor sets up from the global context.encode(byte[])always rejects.
Method Details
getName
encode
Verify the bytes are 7-bit clean and return them as text.- Specified by:
encodein classEncoding- Parameters:
in- the byte array to encode- Returns:
- the encoded string, SMTP-safe
- Throws:
EncodingException- always; 7bit decodes but has no encoder
decode
Pass the bytes through after checking they are 7-bit.- Overrides:
decodein classEncoding- Parameters:
in- the byte array to decodeoffset- the starting position in the arraylength- the number of bytes to decode- Returns:
- a buffer containing the decoded data as a String
- Throws:
DecodingException- on illegal characters
decode
decode
Copy in to out, unchanged We don't do any 8-bit checks like we do for decode(byte[]).- Specified by:
decodein classEncoding- Parameters:
in- the input stream to read data fromout- the buffer to write decoded data to- Throws:
IOException- if reading from input stream fails- See Also: