go2hx

manual

github

Module: stdgo.encoding.ascii85

(view library index)

Overview

Index

Classes

import

class Ascii85

Package ascii85 implements the ascii85 data encoding
    as used in the btoa tool and Adobe's PostScript and PDF document formats.

Ascii85 function decode

function decode(_dst:Array<UInt>, _src:Array<UInt>, _flush:Bool):stdgo.Tuple3<Int, Int, stdgo.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.

(view code)

Ascii85 function encode

function encode(_dst:Array<UInt>, _src:Array<UInt>):Int
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.

(view code)

Ascii85 function maxEncodedLen

function maxEncodedLen(_n:Int):Int

MaxEncodedLen returns the maximum length of an encoding of n source bytes.

(view code)

Ascii85 function newDecoder

function newDecoder(_r:stdgo._internal.io.Reader):stdgo._internal.io.Reader

NewDecoder constructs a new ascii85 stream decoder.

(view code)

Ascii85 function newEncoder

function newEncoder(_w:stdgo._internal.io.Writer):stdgo._internal.io.WriteCloser
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.

(view code)

Typedefs

import

typedef CorruptInputError

typedef CorruptInputError = stdgo._internal.encoding.ascii85.CorruptInputError;

Abstracts

abstract T_encoder

(view file containing code)

abstract T_decoder

(view file containing code)