writeInteger(_:reservedCapacity:to:)
ByteBuffer-binaryEncodedLengthPrefix.swift:70func writeInteger<IntegerType>(_ integer: IntegerType, reservedCapacity: Int, to buffer: inout ByteBuffer) -> Int where IntegerType : FixedWidthInteger
func writeInteger<IntegerType>(_ integer: IntegerType, reservedCapacity: Int, to buffer: inout ByteBuffer) -> Int where IntegerType : FixedWidthInteger
s7NIOCore32NIOBinaryIntegerEncodingStrategyPAAE05writeC0_16reservedCapacity2toSiqd___SiAA10ByteBufferVzts010FixedWidthC0Rd__lF
What are these?1FGO0
import NIOCore
The core abstractions that make up SwiftNIO.
protocol NIOBinaryIntegerEncodingStrategy
Describes a way to encode and decode an integer as bytes. For more information, see ByteBuffer-lengthPrefix
@frozen struct Int
A signed integer value type.
struct ByteBuffer
ByteBuffer
stores contiguously allocated raw bytes. It is a random and sequential accessible sequence of zero or more bytes (octets).
protocol FixedWidthInteger : BinaryInteger, LosslessStringConvertible where Self.Magnitude : FixedWidthInteger, Self.Magnitude : UnsignedInteger, Self.Stride : FixedWidthInteger, Self.Stride : SignedInteger
An integer type that uses a fixed size for every instance.
func writeInteger(_ integer: Int, reservedCapacity: Int, to buffer: inout ByteBuffer) -> Int
Write an integer to a buffer. Move the writer index to after the written integer. This function will be called when an integer needs to be written, and some capacity has already been reserved for it. Implementers should consider using a less efficient encoding, if possible, to fit exactly within the reserved capacity. Otherwise, the caller will need to shift bytes to reconcile the difference. It is up to the implementer to find the balance between performance and size.
var requiredBytesHint: Int { get }