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
+26.4k Golang : Get executable name behind process ID example
+7.2k Golang : Check if one string(rune) is permutation of another string(rune)
+4.5k Java : Generate multiplication table example
+46.2k Golang : Read tab delimited file with encoding/csv package
+6.6k Golang : Totalize or add-up an array or slice example
+38.1k Golang : Read a text file and replace certain words
+11.8k Golang : GTK Input dialog box examples
+23.1k Golang : simulate tail -f or read last line from log file example
+29.3k Golang : Save map/struct to JSON or XML file
+15.3k nginx: [emerg] unknown directive "ssl"
+14.4k Golang : Recombine chunked files example
+9k Golang : Go as a script or running go with shebang/hashbang style