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
+7.5k Golang : Dealing with struct's private part
+9k Golang : Go as a script or running go with shebang/hashbang style
+13.5k Golang : Read XML elements data with xml.CharData example
+36.5k Golang : Save image to PNG, JPEG or GIF format.
+19k Golang : Padding data for encryption and un-padding data for decryption
+6.7k Golang : Check if password length meet the requirement
+7.8k Swift : Convert (cast) String to Double
+19.9k Golang : How to get time from unix nano example
+5.3k Javascript : Shuffle or randomize array example
+30.4k Golang : How to verify uploaded file is image or allowed file types
+16.5k Golang : File path independent of Operating System
+14.2k Golang : syscall.Socket example