Imports #
"io"
"strconv"
"io"
"strconv"
type CorruptInputError int64
type decoder struct {
err error
readErr error
r io.Reader
buf [1024]byte
nbuf int
out []byte
outbuf [1024]byte
}
type encoder struct {
err error
w io.Writer
buf [4]byte
nbuf int
out [1024]byte
}
Close flushes any pending output from the encoder. It is an error to call Write after calling Close.
func (e *encoder) Close() error
Decode decodes src into dst, returning both the number of bytes written to dst and the number consumed from src. If src contains invalid ascii85 data, Decode will return the number of bytes successfully written and a [CorruptInputError]. Decode ignores space and control characters in src. Often, ascii85-encoded data is wrapped in <~ and ~> symbols. Decode expects these to have been stripped by the caller. If flush is true, Decode assumes that src represents the end of the input stream and processes it completely rather than wait for the completion of another 32-bit block. [NewDecoder] wraps an [io.Reader] interface around Decode.
func Decode(dst []byte, src []byte, flush bool) (ndst int, nsrc int, err error)
Encode encodes src into at most [MaxEncodedLen](len(src)) bytes of dst, returning the actual number of bytes written. The encoding handles 4-byte chunks, using a special encoding for the last fragment, so Encode is not appropriate for use on individual blocks of a large data stream. Use [NewEncoder] instead. Often, ascii85-encoded data is wrapped in <~ and ~> symbols. Encode does not add these.
func Encode(dst []byte, src []byte) int
func (e CorruptInputError) Error() string
MaxEncodedLen returns the maximum length of an encoding of n source bytes.
func MaxEncodedLen(n int) int
NewDecoder constructs a new ascii85 stream decoder.
func NewDecoder(r io.Reader) io.Reader
NewEncoder returns a new ascii85 stream encoder. Data written to the returned writer will be encoded and then written to w. Ascii85 encodings operate in 32-bit blocks; when finished writing, the caller must Close the returned encoder to flush any trailing partial block.
func NewEncoder(w io.Writer) io.WriteCloser
func (d *decoder) Read(p []byte) (n int, err error)
func (e *encoder) Write(p []byte) (n int, err error)
Generated with Arrow