diff options
| author | Jianfei Wang <wjf@megvii.com> | 2016-04-06 17:03:32 +0800 |
|---|---|---|
| committer | Jianfei Wang <me@thinxer.com> | 2016-04-09 14:38:01 +0800 |
| commit | 18254d9aaef18f6b836a710e7726711da9aef543 (patch) | |
| tree | cfc771c2b9705fc8eab34a1ec1232d3af22cda0f /go/storage/volume_super_block.go | |
| parent | f0cc264757f433457cc5bd306f1ba8be321ee26b (diff) | |
| download | seaweedfs-18254d9aaef18f6b836a710e7726711da9aef543.tar.xz seaweedfs-18254d9aaef18f6b836a710e7726711da9aef543.zip | |
replace util/bytes.go with binary.BigEndian
Diffstat (limited to 'go/storage/volume_super_block.go')
| -rw-r--r-- | go/storage/volume_super_block.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/go/storage/volume_super_block.go b/go/storage/volume_super_block.go index e37360075..76116090d 100644 --- a/go/storage/volume_super_block.go +++ b/go/storage/volume_super_block.go @@ -1,11 +1,11 @@ package storage import ( + "encoding/binary" "fmt" "os" "github.com/chrislusf/seaweedfs/go/glog" - "github.com/chrislusf/seaweedfs/go/util" ) const ( @@ -35,7 +35,7 @@ func (s *SuperBlock) Bytes() []byte { header[0] = byte(s.version) header[1] = s.ReplicaPlacement.Byte() s.Ttl.ToBytes(header[2:4]) - util.Uint16toBytes(header[4:6], s.CompactRevision) + binary.BigEndian.PutUint16(header[4:6], s.CompactRevision) return header } @@ -76,6 +76,6 @@ func ParseSuperBlock(header []byte) (superBlock SuperBlock, err error) { err = fmt.Errorf("cannot read replica type: %s", err.Error()) } superBlock.Ttl = LoadTTLFromBytes(header[2:4]) - superBlock.CompactRevision = util.BytesToUint16(header[4:6]) + superBlock.CompactRevision = binary.BigEndian.Uint16(header[4:6]) return } |
