protected override byte[] doDecoding(byte[] bytes) {// throws DecoderException { if (bytes == null) { return(null); } bool hasUnderscores = false; for (int i = 0; i < bytes.Length; i++) { if (bytes[i] == UNDERSCORE) { hasUnderscores = true; break; } } if (hasUnderscores) { byte[] tmp = new byte[bytes.Length]; for (int i = 0; i < bytes.Length; i++) { byte b = bytes[i]; if (b != UNDERSCORE) { tmp[i] = b; } else { tmp[i] = BLANK; } } return(QuotedPrintableCodec.decodeQuotedPrintable(tmp)); } return(QuotedPrintableCodec.decodeQuotedPrintable(bytes)); }
protected override byte[] doEncoding(byte[] bytes) { if (bytes == null) { return(null); } byte[] data = QuotedPrintableCodec.encodeQuotedPrintable(PRINTABLE_CHARS, bytes); if (this.encodeBlanks) { for (int i = 0; i < data.Length; i++) { if (data[i] == BLANK) { data[i] = UNDERSCORE; } } } return(data); }