Imports #
"bufio"
"bytes"
"fmt"
"io"
"io"
"bufio"
"bytes"
"fmt"
"io"
"io"
var crlf = *ast.CallExprvar lf = *ast.CallExprconst lineMaxLen = 76var softSuffix = *ast.CallExprconst upperhex = "0123456789ABCDEF"Reader is a quoted-printable decoder.
type Reader struct {
br *bufio.Reader
rerr error
line []byte
}A Writer is a quoted-printable writer that implements [io.WriteCloser].
type Writer struct {
Binary bool
w io.Writer
i int
line [78]byte
cr bool
}Close closes the [Writer], flushing any unwritten data to the underlying [io.Writer], but does not close the underlying io.Writer.
func (w *Writer) Close() errorNewReader returns a quoted-printable reader, decoding from r.
func NewReader(r io.Reader) *ReaderNewWriter returns a new [Writer] that writes to w.
func NewWriter(w io.Writer) *WriterRead reads and decodes quoted-printable data from the underlying reader.
func (r *Reader) Read(p []byte) (n int, err error)Write encodes p using quoted-printable encoding and writes it to the underlying [io.Writer]. It limits line length to 76 characters. The encoded bytes are not necessarily flushed until the [Writer] is closed.
func (w *Writer) Write(p []byte) (n int, err error)checkLastByte encodes the last buffered byte if it is a space or a tab.
func (w *Writer) checkLastByte() errorfunc (w *Writer) encode(b byte) errorfunc (w *Writer) flush() errorfunc fromHex(b byte) (byte, error)func (w *Writer) insertCRLF() errorfunc (w *Writer) insertSoftLineBreak() errorfunc isQPDiscardWhitespace(r rune) boolfunc isWhitespace(b byte) boolfunc readHexByte(v []byte) (b byte, err error)write limits text encoded in quoted-printable to 76 characters per line.
func (w *Writer) write(p []byte) errorGenerated with Arrow