// storedSize calculates the stored size, including header.
// The function returns the size in bits and whether the block
// fits inside a single block.
359752
func (w *huffmanBitWriter) storedSize(in []byte) (int, bool) {
	if in == nil {
		return 0, false
	}
	if len(in) <= maxStoreBlockSize {
		return (len(in) + 5) * 8, true
	}
	return 0, false
}
69239
func HeaderSize(h Header) (n int) {
	switch {
	case h.Length < 126:
		n = 2
	case h.Length <= len16:
		n = 4
	case h.Length <= len64:
		n = 10
	default:
		return -1
	}
	if h.Masked {
		n += len(h.Mask)
	}
	return n
}
534413
func resize(bs []byte, size int) []byte {
	if cap(bs) < size {
		return make([]byte, size)
	}
	return bs[:size]
}
188982
func (s *ValidStorageOptions) SetStorageSize(v []*Range) *ValidStorageOptions {
	s.StorageSize = v
	return s
}
722807
func (h *Header) Size() common.StorageSize {
	return headerSize + common.StorageSize(len(h.Extra)+(h.Difficulty.BitLen()+h.Number.BitLen())/8)
}
1175455
func (b *block) resize(n int) {
	if n > cap(b.data) {
		b.reserve(n)
	}
	b.data = b.data[0:n]
}
742446
func (d *Datastore) GetSize(key ds.Key) (size int, err error) {
	return d.child.GetSize(d.ConvertKey(key))
}
755561
func (f *Field) CacheSize() uint32 {
	f.mu.RLock()
	v := f.options.CacheSize
	f.mu.RUnlock()
	return v
}
136505
func (c *Cache) Size() int64 {
	c.Lock()
	defer c.Unlock()
	return c.size
}
859603
func (ed encryptedData) Size() int {
	return cache.IntSize /* ed.Version */ +
		cache.PtrSize + len(ed.EncryptedData) + cache.PtrSize + len(ed.Nonce)
}
587804
func (h *BindHandle) Size() int {
	size := 0
	for _, bindRecords := range h.bindInfo.Load().(cache) {
		size += len(bindRecords)
	}
	return size
}
826707
func (bb *Builder) PartsSize() int64 {
	n := int64(0)
	if parts, ok := bb.m["parts"].([]BytesPart); ok {
		for _, part := range parts {
			n += int64(part.Size)
		}
	}
	return n
}
1283577
func (r *Application) Storage(disk float64) *Application {
	r.Disk = &disk
	return r
}
968870
func encodedSize(src string, enc Encoding) int {
	if enc.Equals(EncodingUTF8) {
		return len(src)
	}

	toXEncoding := resolveXEncoding(nil, enc)
	encoded, _ := toXEncoding.Encoder().String(src)
	return len(encoded)
}
252155
func (s *BulkProcessorService) BulkSize(bulkSize int) *BulkProcessorService {
	s.bulkSize = bulkSize
	return s
}
1180870
func ComputeBlockSize(fileSize int64, blockIndex int64) int64 {
	if BlockSize*(blockIndex+1) > fileSize {
		return fileSize % BlockSize
	}
	return BlockSize
}
545516
func (mc *cache) Size() int {
	mc.mu.Lock()
	defer mc.mu.Unlock()
	return mc.size
}