Documentation ¶
Index ¶
- func Float32() parser.Func[byte, float32]
- func Float64() parser.Func[byte, float64]
- func Int16() parser.Func[byte, int16]
- func Int32() parser.Func[byte, int32]
- func Int64() parser.Func[byte, int64]
- func Uint16() parser.Func[byte, uint16]
- func Uint32() parser.Func[byte, uint32]
- func Uint64() parser.Func[byte, uint64]
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Float32 ¶
Float32 reads a float32 out of the byte stream with the little endianess.
Example ¶
package main import ( "fmt" "github.com/flier/gocombine/pkg/parser/bytes/le" ) func main() { p := le.Float32() fmt.Println(p([]byte{0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF})) }
Output: 1.7378244e+34 [144 171 205 239] <nil>
func Float64 ¶
Float64 reads a float64 out of the byte stream with the little endianess.
Example ¶
package main import ( "fmt" "github.com/flier/gocombine/pkg/parser/bytes/le" ) func main() { p := le.Float64() fmt.Println(p([]byte{0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF})) }
Output: -3.5987094278483163e+230 [] <nil>
func Int16 ¶
Int16 reads a int16 out of the byte stream with the little endianess.
Example ¶
package main import ( "fmt" "github.com/flier/gocombine/pkg/parser/bytes/le" ) func main() { p := le.Int16() fmt.Println(p([]byte{0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF})) }
Output: 13330 [86 120 144 171 205 239] <nil>
func Int32 ¶
Int32 reads a int32 out of the byte stream with the little endianess.
Example ¶
package main import ( "fmt" "github.com/flier/gocombine/pkg/parser/bytes/le" ) func main() { p := le.Int32() fmt.Println(p([]byte{0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF})) }
Output: 2018915346 [144 171 205 239] <nil>
func Int64 ¶
Int64 reads a int64 out of the byte stream with the little endianess.
Example ¶
package main import ( "fmt" "github.com/flier/gocombine/pkg/parser/bytes/le" ) func main() { p := le.Int64() fmt.Println(p([]byte{0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF})) }
Output: -1167088091436534766 [] <nil>
func Uint16 ¶
Uint16 reads a uint16 out of the byte stream with the little endianess.
Example ¶
package main import ( "fmt" "github.com/flier/gocombine/pkg/parser/bytes/le" ) func main() { p := le.Uint16() fmt.Println(p([]byte{0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF})) }
Output: 13330 [86 120 144 171 205 239] <nil>
func Uint32 ¶
Uint32 reads a uint32 out of the byte stream with the little endianess.
Example ¶
package main import ( "fmt" "github.com/flier/gocombine/pkg/parser/bytes/le" ) func main() { p := le.Uint32() fmt.Println(p([]byte{0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF})) }
Output: 2018915346 [144 171 205 239] <nil>
func Uint64 ¶
Uint64 reads a uint64 out of the byte stream with the little endianess.
Example ¶
package main import ( "fmt" "github.com/flier/gocombine/pkg/parser/bytes/le" ) func main() { p := le.Uint64() fmt.Println(p([]byte{0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF})) }
Output: 17279655982273016850 [] <nil>
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.