<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Network",
  "identifier" : "/documentation/Network/TLV/init(type:length:_:)-h8s",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Network"
    ],
    "preciseIdentifier" : "s:7Network3TLVV4type6length_ACxm_q_mq0_yXEtcs8SendableRzSURzsAFR_SUR_AA14StreamProtocolR0_r1_lufc"
  },
  "title" : "init(type:length:_:)"
}
-->

# init(type:length:_:)

Create TLV with the specified sizes for the type and length fields.

```
init<T, L, BelowProtocol>(type: T.Type, length: L.Type, @ProtocolStackBuilder<BelowProtocol> _ builder: () -> BelowProtocol) where T : Sendable, T : UnsignedInteger, L : Sendable, L : UnsignedInteger, BelowProtocol : StreamProtocol
```

## Parameters

`type`

The object type to use for the `type` field.

`length`

The object type to use for the `length` field.

`builder`

The protocol stack below TLV.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)