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
+13k Golang : Get terminal width and height example
+6k Golang : Convert Chinese UTF8 characters to Pin Yin
+6.3k PHP : How to handle URI or URL with non-ASCII characters such as Chinese/Japanese/Korean(CJK) ?
+9.9k Golang : Ordinal and Ordinalize a given number to the English ordinal numeral
+8.1k Golang : How To Use Panic and Recover
+7.8k Golang : Example of how to detect which type of script a word belongs to
+7.2k Golang : Dealing with postal or zip code example
+6.8k Golang : Muxing with Martini example
+87.8k Golang : How to convert character to ASCII and back