private static class DiscoveryV2.DatagramBuffers extends Object implements DatagramBufferFactory
Modifier and Type | Class and Description |
---|---|
private class |
DiscoveryV2.DatagramBuffers.DatagramInfo |
Modifier and Type | Field and Description |
---|---|
private InetAddress |
addr |
private List |
datagrams |
private long |
formatId |
private int |
maxPacketSize |
private byte |
packetType |
private static int |
TRIM_THRESHOLD |
Constructor and Description |
---|
DiscoveryV2.DatagramBuffers(InetAddress addr,
int maxPacketSize,
byte packetType,
long formatId) |
Modifier and Type | Method and Description |
---|---|
(package private) DatagramPacket[] |
getDatagrams() |
ByteBuffer |
newBuffer()
Returns a byte buffer into which to write encoded multicast packet data.
|
private static final int TRIM_THRESHOLD
private final List datagrams
private final InetAddress addr
private final int maxPacketSize
private final byte packetType
private final long formatId
DiscoveryV2.DatagramBuffers(InetAddress addr, int maxPacketSize, byte packetType, long formatId)
public ByteBuffer newBuffer()
DatagramBufferFactory
0
corresponds to the start of packet data, and the
capacity of the buffer indicates the maximum packet size. Encoding
methods should start writing data at the initial (non-zero) position of
the buffer; the final position of the buffer after the encoding method
has returned is used to mark the end of encoded data, which translates
into the actual length of the sent packet.newBuffer
in interface DatagramBufferFactory
DatagramPacket[] getDatagrams()
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.