public class Plaintext extends Object
Modifier and Type | Method and Description |
---|---|
static void |
checkConstraints(InvocationConstraints constraints)
Returns normally if the given constraints can be satisfied by a
plaintext-based format/protocol (such as net.jini.discovery.plaintext,
or version 1 of the discovery protocols); otherwise, throws an
UnsupportedConstraintException .
|
static MulticastAnnouncement |
decodeMulticastAnnouncement(ByteBuffer buf)
Decodes multicast announcement according to the
net.jini.discovery.plaintext format.
|
static MulticastRequest |
decodeMulticastRequest(ByteBuffer buf)
Decodes multicast request according to the net.jini.discovery.plaintext
format.
|
static void |
encodeMulticastAnnouncement(MulticastAnnouncement announcement,
DatagramBufferFactory bufs)
Encodes multicast announcement according to the
net.jini.discovery.plaintext format.
|
static void |
encodeMulticastRequest(MulticastRequest request,
DatagramBufferFactory bufs)
Encodes multicast request according to the net.jini.discovery.plaintext
format.
|
static String |
getUtf(ByteBuffer buf)
Returns string read from the given buffer in UTF format , starting at
the buffer's current position and not exceeding its limit.
|
static short |
intToUshort(int i)
Returns the given integer value as an unsigned short, throwing an
IllegalArgumentException if the value is negative or too large.
|
static void |
putUtf(ByteBuffer buf,
String s)
Writes the given string to the provided buffer in UTF format, starting
at the buffer's current position and not exceeding its limit.
|
static UnicastResponse |
readUnicastResponse(InputStream in,
ClassLoader defaultLoader,
boolean verifyCodebaseIntegrity,
ClassLoader verifierLoader,
Collection context)
Reads unicast response according to the net.jini.discovery.plaintext
format.
|
static UnicastResponse |
readV2UnicastResponse(InputStream in,
ClassLoader defaultLoader,
boolean verifyCodebaseIntegrity,
ClassLoader verifierLoader,
Collection context)
Reads unicast response similar to the net.jini.discovery.plaintext
format, but with the exception of not using a MarshalledInstance of
the Proxy, but an AtomicMarshalInputStream to directly receive it instead.
|
static byte[] |
toUtf(String s)
Returns a byte array containing the UTF encoding of the given string.
|
static int |
ushortToInt(short s)
Returns an integer with the unsigned value of the given short.
|
static void |
writeUnicastResponse(OutputStream out,
UnicastResponse response,
Collection context)
Writes unicast response according to the net.jini.discovery.plaintext
format.
|
static void |
writeV2UnicastResponse(OutputStream out,
UnicastResponse response,
Collection context)
Writes unicast response according to the net.jini.discovery.plaintext
format, with the exception that the registrar proxy is written using
AtomicMarshalOutputStream, compatible with MarshalOutputStream
format (codebase annotations are written to the stream).
|
public static short intToUshort(int i)
public static int ushortToInt(short s)
public static byte[] toUtf(String s) throws UTFDataFormatException
UTFDataFormatException
public static void putUtf(ByteBuffer buf, String s) throws UTFDataFormatException
UTFDataFormatException
public static String getUtf(ByteBuffer buf) throws UTFDataFormatException
UTFDataFormatException
public static void checkConstraints(InvocationConstraints constraints) throws UnsupportedConstraintException
UnsupportedConstraintException
public static void encodeMulticastRequest(MulticastRequest request, DatagramBufferFactory bufs) throws IOException
IOException
public static MulticastRequest decodeMulticastRequest(ByteBuffer buf) throws IOException
IOException
public static void encodeMulticastAnnouncement(MulticastAnnouncement announcement, DatagramBufferFactory bufs) throws IOException
IOException
public static MulticastAnnouncement decodeMulticastAnnouncement(ByteBuffer buf) throws IOException
IOException
public static void writeUnicastResponse(OutputStream out, UnicastResponse response, Collection context) throws IOException
IOException
public static void writeV2UnicastResponse(OutputStream out, UnicastResponse response, Collection context) throws IOException
IOException
public static UnicastResponse readUnicastResponse(InputStream in, ClassLoader defaultLoader, boolean verifyCodebaseIntegrity, ClassLoader verifierLoader, Collection context) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
public static UnicastResponse readV2UnicastResponse(InputStream in, ClassLoader defaultLoader, boolean verifyCodebaseIntegrity, ClassLoader verifierLoader, Collection context) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
Copyright © 2016–2018 The Apache Software Foundation. All rights reserved.