// XferLen returns the length of the data buffer this command provides for transfering data to/from the kernel.
326590
func (c *SCSICmd) XferLen() uint32 {
	order := binary.BigEndian
	switch c.CdbLen() {
	case 6:
		return uint32(c.cdb[4])
	case 10:
		return uint32(order.Uint16(c.cdb[7:9]))
	case 12:
		return uint32(order.Uint32(c.cdb[6:10]))
	case 16:
		return uint32(order.Uint32(c.cdb[10:14]))
	default:
		log.Errorf("What XferLen has this length: %d", c.CdbLen())
		panic("unusal scsi command length")
	}
}
170112
func (b *Buffer) Len() int {
	version := b.preOp()
	n := b.buf.Len()
	b.postOp(version)
	return n
}
283558
func get(path string, name string, getxattrFunc getxattrFunc) ([]byte, error) {
	const (
		// Start with a 1 KB buffer for the xattr value
		initialBufSize = 1024

		// The theoretical maximum xattr value size on MacOS is 64 MB. On Linux it's
		// much smaller at 64 KB. Unless the kernel is evil or buggy, we should never
		// hit the limit.
		maxBufSize = 64 * 1024 * 1024

		// Function name as reported in error messages
		myname = "xattr.get"
	)

	size := initialBufSize
	for {
		data := make([]byte, size)
		read, err := getxattrFunc(name, data)

		// If the buffer was too small to fit the value, Linux and MacOS react
		// differently:
		// Linux: returns an ERANGE error and "-1" bytes.
		// MacOS: truncates the value and returns "size" bytes. If the value
		//   happens to be exactly as big as the buffer, we cannot know if it was
		//   truncated, and we retry with a bigger buffer. Contrary to documentation,
		//   MacOS never seems to return ERANGE!
		// To keep the code simple, we always check both conditions, and sometimes
		// double the buffer size without it being strictly neccessary.
		if err == syscall.ERANGE || read == size {
			// The buffer was too small. Try again.
			size <<= 1
			if size >= maxBufSize {
				return nil, &Error{myname, path, name, syscall.EOVERFLOW}
			}
			continue
		}
		if err != nil {
			return nil, &Error{myname, path, name, err}
		}
		return data[:read], nil
	}
}
923121
func (p *Prefix) Len() (length int) {
	length = len(p.Name)
	if len(p.User) > 0 {
		length = length + len(p.User) + 1
	}
	if len(p.Host) > 0 {
		length = length + len(p.Host) + 1
	}
	return
}
1156645
func (p *Pixbuf) GetPixelsWithLength() []byte {
	panic_if_version_older(2, 26, 0, "gdk_pixbuf_get_pixels_with_length()")
	length := C.guint(0)
	ptr := C._gdk_pixbuf_get_pixels_with_length(
		p.GPixbuf,
		&length,
	)
	return (*[1 << 30]byte)(unsafe.Pointer(ptr))[:length]
}
552375
func (p *ConnPool) IdleLen() int {
	p.connsMu.Lock()
	n := p.idleConnsLen
	p.connsMu.Unlock()
	return n
}
46891
func (b *PCMBuffer) Len() int {
	if b == nil {
		return 0
	}

	switch b.DataType {
	case DataTypeI8:
		return len(b.I8)
	case DataTypeI16:
		return len(b.I16)
	case DataTypeI32:
		return len(b.I32)
	case DataTypeF32:
		return len(b.F32)
	case DataTypeF64:
		return len(b.F64)
	default:
		return 0
	}
}
1216310
func (h *hostsMap) Len() int {
	l := 0
	for _, v4 := range h.byNameV4 {
		l += len(v4)
	}
	for _, v6 := range h.byNameV6 {
		l += len(v6)
	}
	for _, a := range h.byAddr {
		l += len(a)
	}
	return l
}
238736
func (m *MultipartStreamer) Len() int64 {
	return m.contentLength + int64(m.bodyBuffer.Len()) + int64(m.closeBuffer.Len())
}
155301
func encodedLen(n int) int {
	const k = aes.BlockSize
	return n/k*k + k + overhead
}
565597
func (b *PackBuffer) WriteLen() int {
	if b.w >= len(b.s) {
		return 0
	}
	return len(b.s) - b.w
}
61801
func (s *SimpleAllocator) AllocWithLen(length int, capacity int) []byte {
	slice := s.Alloc(capacity)
	return slice[:length:capacity]
}
1151573
func SharedPrefixLen(a, b []byte) int {
	i, n := 0, len(a)
	if n > len(b) {
		n = len(b)
	}
	for i < n && a[i] == b[i] {
		i++
	}
	return i
}
626395
func (f *StreamFrame) DataLen() protocol.ByteCount {
	return protocol.ByteCount(len(f.Data))
}
26565
func (pool *Pool) MaxLen(maxlen int) *Pool {
	pool.conf.MaxLen = maxlen
	return &Pool{redis: pool.redis, conf: pool.conf}
}
1095217
func (f *StreamFrame) Length(version protocol.VersionNumber) protocol.ByteCount {
	length := 1 + utils.VarIntLen(uint64(f.StreamID))
	if f.Offset != 0 {
		length += utils.VarIntLen(uint64(f.Offset))
	}
	if f.DataLenPresent {
		length += utils.VarIntLen(uint64(f.DataLen()))
	}
	return length + f.DataLen()
}
155057
func getLen(x interface{}) (ok bool, length int) {
	v := reflect.ValueOf(x)
	defer func() {
		if e := recover(); e != nil {
			ok = false
		}
	}()
	return true, v.Len()
}