com.sun.jini.discovery
Class DiscoveryV2.DatagramBuffers

java.lang.Object
  extended by 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.


Nested Class Summary
private  class DiscoveryV2.DatagramBuffers.DatagramInfo
           
 
Field Summary
private  InetAddress addr
           
private  List datagrams
           
private  long formatId
           
private  int maxPacketSize
           
private  byte packetType
           
private static int TRIM_THRESHOLD
           
 
Constructor Summary
DiscoveryV2.DatagramBuffers(InetAddress addr, int maxPacketSize, byte packetType, long formatId)
           
 
Method Summary
(package private)  DatagramPacket[] getDatagrams()
           
 ByteBuffer newBuffer()
          Returns a byte buffer into which to write encoded multicast packet data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

DiscoveryV2.DatagramBuffers

DiscoveryV2.DatagramBuffers(InetAddress addr,
                            int maxPacketSize,
                            byte packetType,
                            long formatId)
Method Detail

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.