Golang bufio.ReadByte() function example
package bufio.ReadByte
ReadByte reads and returns a single byte. If no byte is available, returns an error.
Golang bufio.ReadByte() function usage example
readbuffer := bytes.NewBuffer([]byte("abcdefg"))
reader := bufio.NewReader(readbuffer)
singlebyte, err := reader.ReadByte()
fmt.Printf("%c \n", singlebyte)
Output :
a
Remember : This function reads single / one byte !
Advertisement
Something interesting
Tutorials
+26.6k Golang : Encrypt and decrypt data with AES crypto
+6.8k Golang : Get expvar(export variables) to work with multiplexer
+5.7k Get website traffic ranking with Similar Web or Alexa
+12.7k Golang : Sort and reverse sort a slice of bytes
+24k Golang : Find biggest/largest number in array
+31.6k Golang : Get local IP and MAC address
+7.2k Golang : Check if one string(rune) is permutation of another string(rune)
+9.9k Golang : Translate language with language package example
+4.7k Golang : How to pass data between controllers with JSON Web Token
+4.4k Golang : Valued expressions and functions example
+8.2k Golang : Find relative luminance or color brightness