public final class Marshalling
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
private static class |
Marshalling.OptionalDataExceptionCreateAction |
private static class |
Marshalling.StaticStreamHeader |
| Modifier and Type | Field and Description |
|---|---|
private static ClassExternalizerFactory |
NULL_CLASS_EXTERNALIZER_FACTORY |
private static ClassTable |
NULL_CLASS_TABLE |
private static Externalizer |
NULL_EXTERNALIZER |
private static ObjectResolver |
NULL_OBJECT_RESOLVER |
private static ObjectTable |
NULL_OBJECT_TABLE |
private static StreamHeader |
NULL_STREAM_HEADER |
private static Marshalling.OptionalDataExceptionCreateAction |
OPTIONAL_DATA_EXCEPTION_CREATE_ACTION |
| Modifier | Constructor and Description |
|---|---|
private |
Marshalling() |
| Modifier and Type | Method and Description |
|---|---|
static ByteInput |
createByteInput(java.nio.ByteBuffer buffer)
Create a
ByteInput wrapper for a ByteBuffer. |
static ByteInput |
createByteInput(java.io.InputStream inputStream)
Create a
ByteInput wrapper for an InputStream. |
static ByteOutput |
createByteOutput(java.nio.ByteBuffer buffer)
Create a
ByteOutput wrapper for a ByteBuffer. |
static ByteOutput |
createByteOutput(java.io.OutputStream outputStream)
Create a
ByteOutput wrapper for an OutputStream. |
static java.io.InputStream |
createInputStream(ByteInput byteInput)
Create an
InputStream wrapper for a ByteInput. |
private static java.io.OptionalDataException |
createOptionalDataException() |
static java.io.OptionalDataException |
createOptionalDataException(boolean eof)
Construct a new
OptionalDataException. |
static java.io.OptionalDataException |
createOptionalDataException(int length)
Construct a new
OptionalDataException. |
static java.io.OutputStream |
createOutputStream(ByteOutput byteOutput)
Create a
OutputStream wrapper for a ByteOutput. |
static MarshallerFactory |
getMarshallerFactory(java.lang.String name)
Deprecated.
It is recommended that you use
getProvidedMarshallerFactory(String) instead; using the context
class loader to find a marshalling implementation is risky at best as the user may have just about anything on their
class path. |
static MarshallerFactory |
getMarshallerFactory(java.lang.String name,
java.lang.ClassLoader classLoader)
Get a marshaller factory, by name.
|
static MarshallerFactory |
getProvidedMarshallerFactory(java.lang.String name)
Get a marshaller factory which is visible to this implementation, by name.
|
private static MarshallerFactory |
loadMarshallerFactory(java.util.ServiceLoader<ProviderDescriptor> loader,
java.lang.String name) |
static ClassExternalizerFactory |
nullClassExternalizerFactory()
Return the null class externalizer factory.
|
static ClassTable |
nullClassTable()
Return the null class table instance.
|
static Externalizer |
nullExternalizer()
Get a null externalizer.
|
static ObjectResolver |
nullObjectResolver()
Return the null object resolver.
|
static ObjectTable |
nullObjectTable()
Return the null object instance table.
|
static StreamHeader |
nullStreamHeader()
Get the default stream header producer, which reads and writes no header at all.
|
static void |
readFully(ByteInput input,
byte[] dest)
Read bytes from a
ByteInput. |
static void |
readFully(ByteInput input,
byte[] dest,
int offs,
int len)
Read bytes from a
ByteInput. |
static StreamHeader |
streamHeader(byte[] headerBytes)
Create a stream header that uses the given bytes.
|
private static final StreamHeader NULL_STREAM_HEADER
private static final ClassExternalizerFactory NULL_CLASS_EXTERNALIZER_FACTORY
private static final ObjectResolver NULL_OBJECT_RESOLVER
private static final ObjectTable NULL_OBJECT_TABLE
private static final ClassTable NULL_CLASS_TABLE
private static final Marshalling.OptionalDataExceptionCreateAction OPTIONAL_DATA_EXCEPTION_CREATE_ACTION
private static final Externalizer NULL_EXTERNALIZER
@Deprecated public static MarshallerFactory getMarshallerFactory(java.lang.String name)
getProvidedMarshallerFactory(String) instead; using the context
class loader to find a marshalling implementation is risky at best as the user may have just about anything on their
class path.name - the name of the protocol to acquirenull if no matching factory was foundServiceLoaderpublic static MarshallerFactory getMarshallerFactory(java.lang.String name, java.lang.ClassLoader classLoader)
name - the name of the protocol to acquireclassLoader - the class loader to usenull if no matching factory was foundServiceLoaderpublic static MarshallerFactory getProvidedMarshallerFactory(java.lang.String name)
name - the name of the protocol to acquirenull if no matching factory was foundprivate static MarshallerFactory loadMarshallerFactory(java.util.ServiceLoader<ProviderDescriptor> loader, java.lang.String name)
public static StreamHeader nullStreamHeader()
public static StreamHeader streamHeader(byte[] headerBytes)
headerBytes - the header bytespublic static void readFully(ByteInput input, byte[] dest) throws java.io.IOException
ByteInput. Fully fills in the array.input - the inputdest - the destinationjava.io.EOFException - if the end of file is reached before the array is filledjava.io.IOException - if an I/O error occurspublic static void readFully(ByteInput input, byte[] dest, int offs, int len) throws java.io.IOException
ByteInput. Fully fills in len bytes in the array.input - the inputdest - the destinationoffs - the offset into the arraylen - the number of bytesjava.io.EOFException - if the end of file is reached before the array is filledjava.io.IOException - if an I/O error occurspublic static ByteInput createByteInput(java.nio.ByteBuffer buffer)
ByteInput wrapper for a ByteBuffer.buffer - the byte bufferpublic static ByteInput createByteInput(java.io.InputStream inputStream)
ByteInput wrapper for an InputStream.inputStream - the input streampublic static java.io.InputStream createInputStream(ByteInput byteInput)
InputStream wrapper for a ByteInput.byteInput - the byte inputpublic static ByteOutput createByteOutput(java.nio.ByteBuffer buffer)
ByteOutput wrapper for a ByteBuffer.buffer - the byte bufferpublic static ByteOutput createByteOutput(java.io.OutputStream outputStream)
ByteOutput wrapper for an OutputStream.outputStream - the output streampublic static java.io.OutputStream createOutputStream(ByteOutput byteOutput)
OutputStream wrapper for a ByteOutput.byteOutput - the byte outputpublic static ClassExternalizerFactory nullClassExternalizerFactory()
public static ObjectResolver nullObjectResolver()
public static ObjectTable nullObjectTable()
public static ClassTable nullClassTable()
public static java.io.OptionalDataException createOptionalDataException(boolean eof)
OptionalDataException. This method is necssary because there are no
public constructors in the API.eof - true if there is no more data in the buffered part of the streampublic static java.io.OptionalDataException createOptionalDataException(int length)
OptionalDataException. This method is necssary because there are no
public constructors in the API.length - the number of bytes of primitive data available to be read in the current bufferprivate static java.io.OptionalDataException createOptionalDataException()
public static Externalizer nullExternalizer()
ObjectTable entries.
This externalizer reads and writes no data.