public final class ByteBufWriteUtil extends Object
Modifier and Type | Field and Description |
---|---|
static int |
FLOAT32_BYTES_LENGTH |
static int |
INT_BYTES_LENGTH |
static int |
IPV4_PREFIX_BYTE_LENGTH |
static int |
IPV6_PREFIX_BYTE_LENGTH |
static int |
LONG_BYTES_LENGTH |
static int |
MEDIUM_BYTES_LENGTH |
static int |
ONE_BYTE_LENGTH |
static int |
SHORT_BYTES_LENGTH |
Modifier and Type | Method and Description |
---|---|
static void |
writeBoolean(Boolean value,
io.netty.buffer.ByteBuf output)
Writes boolean
value if not null, otherwise writes zero to
the output ByteBuf. |
static void |
writeFloat32(Float32 value,
io.netty.buffer.ByteBuf output)
Writes Float32
value if not null, otherwise writes zeros to
the output ByteBuf. |
static void |
writeInt(Integer value,
io.netty.buffer.ByteBuf output)
Writes 32-bit integer
value if not null, otherwise writes
zeros to the output ByteBuf. |
static void |
writeIpv4Address(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address ipv4Address,
io.netty.buffer.ByteBuf output)
Writes IPv4 address if not null, otherwise writes zeros to the
output ByteBuf. |
static void |
writeIpv4Prefix(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix ipv4Prefix,
io.netty.buffer.ByteBuf output)
Writes IPv4 prefix if not null, otherwise writes zeros to the
output ByteBuf. |
static void |
writeIpv6Address(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address ipv6Address,
io.netty.buffer.ByteBuf output)
Writes IPv6 address if not null, otherwise writes zeros to the
output ByteBuf. |
static void |
writeIpv6Prefix(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix ipv6Prefix,
io.netty.buffer.ByteBuf output)
Writes IPv6 prefix if not null, otherwise writes zeros to the
output ByteBuf. |
static void |
writeLong(Long value,
io.netty.buffer.ByteBuf output)
Writes 64-bit long
value if not null, otherwise writes zeros
to the output ByteBuf. |
static void |
writeMedium(Integer value,
io.netty.buffer.ByteBuf output)
Writes 24-bit integer
value if not null, otherwise writes
zeros to the output ByteBuf. |
static void |
writeMinimalPrefix(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix ipv4Prefix,
io.netty.buffer.ByteBuf output) |
static void |
writeMinimalPrefix(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix ipv6Prefix,
io.netty.buffer.ByteBuf output) |
static void |
writeShort(Short value,
io.netty.buffer.ByteBuf output)
Writes 16-bit short
value if not null, otherwise writes
zeros to the output ByteBuf. |
static void |
writeUnsignedByte(Short value,
io.netty.buffer.ByteBuf output)
Writes unsigned byte
value if not null, otherwise writes
zero to the output ByteBuf. |
static void |
writeUnsignedInt(Long value,
io.netty.buffer.ByteBuf output)
Writes unsigned 32-bit integer
value if not null, otherwise
writes zeros to the output ByteBuf. |
static void |
writeUnsignedLong(BigInteger value,
io.netty.buffer.ByteBuf output)
Writes unsigned 64-bit integer
value if not null, otherwise
writes zeros to the output ByteBuf. |
static void |
writeUnsignedShort(Integer value,
io.netty.buffer.ByteBuf output)
Writes unsigned 16-bit short integer
value if not null,
otherwise writes zeros to the output ByteBuf. |
public static final int SHORT_BYTES_LENGTH
public static final int MEDIUM_BYTES_LENGTH
public static final int INT_BYTES_LENGTH
public static final int LONG_BYTES_LENGTH
public static final int FLOAT32_BYTES_LENGTH
public static final int ONE_BYTE_LENGTH
public static final int IPV4_PREFIX_BYTE_LENGTH
public static final int IPV6_PREFIX_BYTE_LENGTH
public static void writeInt(Integer value, io.netty.buffer.ByteBuf output)
value
if not null, otherwise writes
zeros to the output
ByteBuf. ByteBuf's writerIndex is
increased by 4.value
- Integer value to be written to the output.output
- ByteBuf, where value or zeros are written.public static void writeMedium(Integer value, io.netty.buffer.ByteBuf output)
value
if not null, otherwise writes
zeros to the output
ByteBuf. ByteBuf's writerIndex is
increased by 3.value
- Medium value to be written to the output.output
- ByteBuf, where value or zeros are written.public static void writeShort(Short value, io.netty.buffer.ByteBuf output)
value
if not null, otherwise writes
zeros to the output
ByteBuf. ByteBuf's writerIndex is
increased by 2.value
- Short value to be written to the output.output
- ByteBuf, where value or zeros are written.public static void writeLong(Long value, io.netty.buffer.ByteBuf output)
value
if not null, otherwise writes zeros
to the output
ByteBuf. ByteBuf's writerIndex is increased by
8.value
- Long value to be written to the output.output
- ByteBuf, where value or zeros are written.public static void writeBoolean(Boolean value, io.netty.buffer.ByteBuf output)
value
if not null, otherwise writes zero to
the output
ByteBuf. ByteBuf's writerIndex is increased by 1.value
- Boolean value to be written to the output.output
- ByteBuf, where value or zero is written.public static void writeUnsignedByte(Short value, io.netty.buffer.ByteBuf output)
value
if not null, otherwise writes
zero to the output
ByteBuf. ByteBuf's writerIndex is
increased by 1.value
- Short value to be write to the output.output
- ByteBuf, where value or zeros are written.public static void writeUnsignedShort(Integer value, io.netty.buffer.ByteBuf output)
value
if not null,
otherwise writes zeros to the output
ByteBuf. ByteBuf's
writerIndex is increased by 2.value
- Integer value to be written to the output.output
- ByteBuf, where value or zeros are written.public static void writeUnsignedInt(Long value, io.netty.buffer.ByteBuf output)
value
if not null, otherwise
writes zeros to the output
ByteBuf. ByteBuf's writerIndex is
increased by 4.value
- Long value to be written to the output.output
- ByteBuf, where value or zeros are written.public static void writeUnsignedLong(BigInteger value, io.netty.buffer.ByteBuf output)
value
if not null, otherwise
writes zeros to the output
ByteBuf. ByteBuf's writerIndex is
increased by 8.value
- BigInteger value to be written to the output.output
- ByteBuf, where value or zeros are written.public static void writeIpv4Address(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address ipv4Address, io.netty.buffer.ByteBuf output)
output
ByteBuf. ByteBuf's writerIndex is increased by 4.ipv4Address
- IPv4 address to be written to the output.output
- ByteBuf, where ipv4Address or zeros are written.public static void writeIpv4Prefix(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix ipv4Prefix, io.netty.buffer.ByteBuf output)
output
ByteBuf. ByteBuf's writerIndex is increased by 5.ipv4Prefix
- IPv4 prefix value to be written to the output. Prefix is
written in the last byte.output
- ByteBuf, where ipv4Prefix or zeros are written.public static void writeIpv6Address(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address ipv6Address, io.netty.buffer.ByteBuf output)
output
ByteBuf. ByteBuf's writerIndex is increased by 16.ipv6Address
- IPv6 address to be written to the output.output
- ByteBuf, where ipv6Address or zeros are written.public static void writeIpv6Prefix(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix ipv6Prefix, io.netty.buffer.ByteBuf output)
output
ByteBuf. ByteBuf's writerIndex is increased by 17.ipv6Prefix
- IPv6 prefix to be written to the output. Prefix is written in
the last byte.output
- ByteBuf, where ipv6Prefix or zeros are written.public static void writeMinimalPrefix(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix ipv4Prefix, io.netty.buffer.ByteBuf output)
public static void writeMinimalPrefix(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix ipv6Prefix, io.netty.buffer.ByteBuf output)
public static void writeFloat32(Float32 value, io.netty.buffer.ByteBuf output)
value
if not null, otherwise writes zeros to
the output
ByteBuf. ByteBuf's writerIndex is increased by 4.value
- Float32 value to be written to the output.output
- ByteBuf, where value or zeros are written.Copyright © 2019 OpenDaylight. All rights reserved.