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
+7.7k Golang : Error reading timestamp with GORM or SQL driver
+20k Golang : How to run your code only once with sync.Once object
+5.8k CodeIgniter/PHP : Remove empty lines above RSS or ATOM xml tag
+18.6k Golang : Get download file size
+17.8k Golang : Defer function inside init()
+11.7k Golang : Calculations using complex numbers example
+5k Golang : micron to centimeter example
+23.7k Find and replace a character in a string in Go
+24.5k Golang : Time slice or date sort and reverse sort example
+9.5k Mac OSX : Get a process/daemon status information
+14.5k Golang : Overwrite previous output with count down timer
+5.9k Unix/Linux : How to open tar.gz file ?