Golang bytes.Buffer.ReadByte() function example
package bytes
ReadByte reads and returns the next byte from the buffer. If no byte is available, it returns error io.EOF.
Golang bytes.Buffer.ReadByte() function usage example
package main
import (
"bytes"
"fmt"
)
func main() {
buff := bytes.NewBufferString("abcdef")
rb, err := buff.ReadByte()
fmt.Printf("%v %d %s\n", err, rb, string(rb))
}
Output :
97 a
Reference :
Advertisement
Something interesting
Tutorials
+25.7k Golang : missing Mercurial command
+4.7k Chrome : How to block socketloop.com links in Google SERP?
+17.2k Google Chrome : Your connection to website is encrypted with obsolete cryptography
+17k Golang : Get input from keyboard
+26.1k Mac/Linux and Golang : Fix bind: address already in use error
+16.3k Golang :Trim white spaces from a string
+51.9k Golang : How to get time in milliseconds?
+12.1k Golang : Sort and reverse sort a slice of runes
+8.4k PHP : How to parse ElasticSearch JSON ?
+32.4k Golang : Math pow(the power of x^y) example
+10.4k Golang : Simple Jawi(Yawi) to Rumi(Latin/Romanize) converter
+32.2k Golang : Convert []string to []byte examples