com.sun.jini.discovery
Class DiscoveryV2.DatagramBuffers
java.lang.Object
com.sun.jini.discovery.DiscoveryV2.DatagramBuffers
- All Implemented Interfaces:
- DatagramBufferFactory
- Enclosing class:
- DiscoveryV2
private static class DiscoveryV2.DatagramBuffers
- extends Object
- implements DatagramBufferFactory
Buffer factory passed to multicast request and announcement encoders.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TRIM_THRESHOLD
private static final int TRIM_THRESHOLD
- See Also:
- Constant Field Values
datagrams
private final List datagrams
addr
private final InetAddress addr
maxPacketSize
private final int maxPacketSize
packetType
private final byte packetType
formatId
private final long formatId
DiscoveryV2.DatagramBuffers
DiscoveryV2.DatagramBuffers(InetAddress addr,
int maxPacketSize,
byte packetType,
long formatId)
newBuffer
public ByteBuffer newBuffer()
- Description copied from interface:
DatagramBufferFactory
- Returns a byte buffer into which to write encoded multicast packet data.
The buffer encompasses all of the data for the packet to be sent: buffer
offset
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.
- Specified by:
newBuffer
in interface DatagramBufferFactory
- Returns:
- a buffer into which to write encoded multicast packet data
getDatagrams
DatagramPacket[] getDatagrams()
Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.