Standard library / encoding/ascii85
encoding/ascii85.NewDecoder()
Wrap an ASCII85 stream as a reader of decoded bytes. Consume the returned reader and handle decoding errors. Expected stdout: 'Go\n'.
Formal Syntax & Structure
go syntaxgo
func NewDecoder(r io.Reader) io.ReaderParameters & Attributes
| Name | Type | Description |
|---|---|---|
| r | io.Reader | Reader supplying encoded data. |
Return Value
io.Reader
Reader wrapping the input.
Working Example
Example Snippetgo
package main
import ( "encoding/ascii85" "fmt" "io" "strings")
func must(e error) { if e != nil { panic(e) }}
func main() { v, err := io.ReadAll(ascii85.NewDecoder(strings.NewReader("7rJ"))) must(err) fmt.Println(string(v))}