Golang encoding/ascii85.NewDecoder function example
package encoding/ascii85
NewDecoder constructs a new ascii85 stream decoder.
Golang encoding/ascii85.NewDecoder function usage example
package main
import (
"encoding/ascii85"
"fmt"
"strings"
"io/ioutil"
)
func main() {
var str string
str = "9jqo^BlbD-BleB1DJ+*+F(f,q/0JhKF<GL>Cj@.4Gp$d7F!,L7@<6@)/0JDEF<G%<+EV:2F!,\n"
decoderstream := ascii85.NewDecoder(strings.NewReader(str))
dstreambuf, err := ioutil.ReadAll(decoderstream)
if err != nil {
fmt.Println(err)
}
fmt.Println(string(dstreambuf))
}
Output :
Man is distinguished, not only by his reason, but by this
Reference :
Advertisement
Something interesting
Tutorials
+10.7k Golang : Underscore string example
+4.1k Javascript : Empty an array example
+14.6k Golang : Convert(cast) int to float example
+7.5k Golang : How to stop user from directly running an executable file?
+5.4k Golang *File points to a file or directory ?
+6.2k Golang : Calculate US Dollar Index (DXY)
+10.2k Golang : How to profile or log time spend on execution?
+4.8k Golang : A program that contain another program and executes it during run-time
+11.7k Golang : Calculations using complex numbers example
+10k Golang : Convert octal value to string to deal with leading zero problem
+22.9k Golang : Gorilla mux routing example
+26.3k Golang : Calculate future date with time.Add() function