numeric fields are all native unboxed.

This commit is contained in:
Jae Kwon
2014-08-30 16:28:51 -07:00
parent d300a67bb1
commit fa382a3b05
9 changed files with 131 additions and 90 deletions

View File

@ -65,6 +65,10 @@ func ReadByte(r io.Reader) Byte {
return b
}
func Readbyte(r io.Reader) byte {
return byte(ReadByte(r))
}
// Int8
func (self Int8) Equals(other interface{}) bool {
@ -113,6 +117,10 @@ func ReadInt8(r io.Reader) Int8 {
return b
}
func Readint8(r io.Reader) int8 {
return int8(ReadInt8(r))
}
// UInt8
func (self UInt8) Equals(other interface{}) bool {
@ -161,6 +169,10 @@ func ReadUInt8(r io.Reader) UInt8 {
return b
}
func Readuint8(r io.Reader) uint8 {
return uint8(ReadUInt8(r))
}
// Int16
func (self Int16) Equals(other interface{}) bool {
@ -211,6 +223,10 @@ func ReadInt16(r io.Reader) Int16 {
return b
}
func Readint16(r io.Reader) int16 {
return int16(ReadInt16(r))
}
// UInt16
func (self UInt16) Equals(other interface{}) bool {
@ -261,6 +277,10 @@ func ReadUInt16(r io.Reader) UInt16 {
return b
}
func Readuint16(r io.Reader) uint16 {
return uint16(ReadUInt16(r))
}
// Int32
func (self Int32) Equals(other interface{}) bool {
@ -311,6 +331,10 @@ func ReadInt32(r io.Reader) Int32 {
return b
}
func Readint32(r io.Reader) int32 {
return int32(ReadInt32(r))
}
// UInt32
func (self UInt32) Equals(other interface{}) bool {
@ -361,6 +385,10 @@ func ReadUInt32(r io.Reader) UInt32 {
return b
}
func Readuint32(r io.Reader) uint32 {
return uint32(ReadUInt32(r))
}
// Int64
func (self Int64) Equals(other interface{}) bool {
@ -411,6 +439,10 @@ func ReadInt64(r io.Reader) Int64 {
return b
}
func Readint64(r io.Reader) int64 {
return int64(ReadInt64(r))
}
// UInt64
func (self UInt64) Equals(other interface{}) bool {
@ -460,3 +492,7 @@ func ReadUInt64(r io.Reader) UInt64 {
}
return b
}
func Readuint64(r io.Reader) uint64 {
return uint64(ReadUInt64(r))
}