java.lang.Object
i2p.susi.webmail.encoding.Encoding
i2p.susi.webmail.encoding.SevenBit

public class SevenBitextends Encoding
Decode only.
  • 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

      public String getName()
      Description copied from class: Encoding
      Returns the name of this encoding.
      Specified by:
      getName in class Encoding
      Returns:
      the encoding name
    • encode

      public String encode(byte[] in) throws EncodingException
      Verify the bytes are 7-bit clean and return them as text.
      Specified by:
      encode in class Encoding
      Parameters:
      in - the byte array to encode
      Returns:
      the encoded string, SMTP-safe
      Throws:
      EncodingException - always; 7bit decodes but has no encoder
    • decode

      public Buffer decode(byte[] in, int offset, int length) throws DecodingException
      Pass the bytes through after checking they are 7-bit.
      Overrides:
      decode in class Encoding
      Parameters:
      in - the byte array to decode
      offset - the starting position in the array
      length - the number of bytes to decode
      Returns:
      a buffer containing the decoded data as a String
      Throws:
      DecodingException - on illegal characters
    • decode

      public Buffer decode(Buffer in)
      We don't do any 8-bit checks like we do for decode(byte[]).
      Overrides:
      decode in class Encoding
      Parameters:
      in - the buffer containing data to decode
      Returns:
      the buffer unchanged, without the 8-bit check decode(byte[]) makes
      See Also:
    • decode

      public void decode(InputStream in, Buffer out) throws IOException
      Copy in to out, unchanged We don't do any 8-bit checks like we do for decode(byte[]).
      Specified by:
      decode in class Encoding
      Parameters:
      in - the input stream to read data from
      out - the buffer to write decoded data to
      Throws:
      IOException - if reading from input stream fails
      See Also: