// Get retrieves an item from the shards internal byte-array.
// It returns a copy of the corresponding byte slice
// and a boolean if the items was contained if the boolean
// is false the slice will be nil.
Get retrieves an item from the shards internal byte-array.
It returns a copy of the corresponding byte slice
and a boolean if the items was contained if the boolean
is false the slice will be nil.
// Get retrieves an item from the shards internal byte - array . // It returns a copy of the corresponding byte slice // and a boolean if the items was contained if the boolean // is false the slice will be nil .
func (S *Shard) Get(key uint64) ([]byte, bool) {
	S.hitExpirationService(key, ExpirationService.BeforeLock)
	S.RLock()
	defer func() {
		S.hitExpirationService(key, ExpirationService.Access)
		S.RUnlock()
		S.hitExpirationService(key, ExpirationService.AfterAccess)
	}()
	S.hitExpirationService(key, ExpirationService.Lock)
	ptr, ok := S.ptrs.Get(key)
	if !ok {
		return nil, false
	}
	dataIndex := ptr + LengthBytes
	dataLength := binary.LittleEndian.Uint64(S.array[ptr:])
	dst := make([]byte, dataLength)
	copy(dst, S.array[dataIndex:dataIndex+dataLength])
	return dst, true
}
func ( S * Shard ) Get ( key uint64 ) ( [ ] byte , bool ) { S . hitExpirationService ( key , ExpirationService . BeforeLock ) S . RLock ( ) defer func ( ) { S . hitExpirationService ( key , ExpirationService . Access ) S . RUnlock ( ) S . hitExpirationService ( key , ExpirationService . AfterAccess ) } ( ) S . hitExpirationService ( key , ExpirationService . Lock ) ptr , ok := S . ptrs . Get ( key ) if ! ok { return nil , false } dataIndex := ptr + LengthBytes dataLength := binary . LittleEndian . Uint64 ( S . array [ ptr : ] ) dst := make ( [ ] byte , dataLength ) copy ( dst , S . array [ dataIndex : dataIndex + dataLength ] ) return dst , true }
Get retrieves an item from the shards internal byte-array.
Get retrieves an item from the shards internal byte - array .