Class EightBit

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

public class EightBit extends Encoding
Decode only. See encode().
Author:
susi
  • Constructor Details

    • EightBit

      public EightBit()
  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in class Encoding
    • encode

      public String encode(byte[] in) throws EncodingException
      TODO would be nice to implement this, as it is supported on the project server, but content must be CRLF terminated with a max of 998 chars per line. And you can't have leading dots either, we'd have to prevent or double-dot it. That would be expensive to check, using either a double read or pulling it all into memory. So it's prohibitive for attachments. We could do it for the message body, since it's in memory already, but that's not much of a win. ref: https://stackoverflow.com/questions/29510178/how-to-handle-1000-character-lines-in-8bit-mime
      Specified by:
      encode in class Encoding
      Returns:
      Encoded string.
      Throws:
      EncodingException - always
    • decode

      public Buffer decode(byte[] in, int offset, int length)
      Overrides:
      decode in class Encoding
      Returns:
      Output buffer containing decoded String.
    • decode

      public Buffer decode(Buffer in)
      Description copied from class: Encoding
      This implementation just calls decode(in.content, in.offset, in.length). Most classes will not need to override.
      Overrides:
      decode in class Encoding
      Returns:
      in unchanged
      See Also:
    • decode

      public void decode(InputStream in, Buffer out) throws IOException
      Copy in to out, unchanged
      Specified by:
      decode in class Encoding
      Throws:
      DecodingException
      IOException
      Since:
      0.9.34
      See Also: