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
+37.7k Golang : Comparing date or timestamp
+13.5k Golang : Count number of runes in string
+34.6k Golang : How to stream file to client(browser) or write to http.ResponseWriter?
+5.6k Unix/Linux : How to find out the hard disk size?
+14.9k Golang : Basic authentication with .htpasswd file
+9.2k Golang : does not implement flag.Value (missing Set method)
+9.1k Golang : Gonum standard normal random numbers example
+16.4k Golang : How to implement two-factor authentication?
+23.9k Golang : Fix type interface{} has no field or no methods and type assertions example
+15.2k JavaScript/JQuery : Detect or intercept enter key pressed example