Instance Method (Default implementation)swift-nio 2.74.0NIOCore

    writeInteger(_:reservedCapacity:to:)

    ByteBuffer-binaryEncodedLengthPrefix.swift:70
    func writeInteger<IntegerType>(_ integer: IntegerType, reservedCapacity: Int, to buffer: inout ByteBuffer) -> Int where IntegerType : FixedWidthInteger

    Implements

    • func writeInteger(Int, reservedCapacity: Int, to: 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.

    Other members in extension

    Instance members