Source File
load_store.go
Belonging Package
compress/flate
// Copyright 2026 The Go Authors. All rights reserved.// Use of this source code is governed by a BSD-style// license that can be found in the LICENSE file.package flate// This file contains functions for loading and storing integers in little endian format.// These can be replaced with unsafe versions if deemed necessary.type indexer interface {int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64}// loadLE8 will load from b at index i.func loadLE8[ indexer]( []byte, ) byte {return []}// loadLE32 will load from b at index i.func loadLE32[ indexer]( []byte, ) uint32 {= [ : +4]return uint32([0]) | uint32([1])<<8 | uint32([2])<<16 | uint32([3])<<24}// loadLE64 will load from b at index i.func loadLE64[ indexer]( []byte, ) uint64 {= [ : +8]return uint64([0]) | uint64([1])<<8 | uint64([2])<<16 | uint64([3])<<24 |uint64([4])<<32 | uint64([5])<<40 | uint64([6])<<48 | uint64([7])<<56}// storeLE64 will store v at start of b.func storeLE64( []byte, uint64) {_ = [7] // early bounds check to guarantee safety of writes below[0] = byte()[1] = byte( >> 8)[2] = byte( >> 16)[3] = byte( >> 24)[4] = byte( >> 32)[5] = byte( >> 40)[6] = byte( >> 48)[7] = byte( >> 56)}
![]() |
The pages are generated with Golds v0.8.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |