For dealing with types not supported by the encoding/binary interface
(v int32)
| 107 | // For dealing with types not supported by the encoding/binary interface |
| 108 | |
| 109 | func PutInt32(v int32) []byte { |
| 110 | buf := make([]byte, 4) |
| 111 | *(*int32)(unsafe.Pointer(&buf[0])) = v |
| 112 | return buf |
| 113 | } |
| 114 | |
| 115 | func Int32(b []byte) int32 { |
| 116 | return *(*int32)(unsafe.Pointer(&b[0])) |
no outgoing calls
searching dependent graphs…