|
JBoss Marshalling 1.3.0.CR9 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.marshalling.Marshalling
public final class Marshalling
Static utility methods for simplifying use of marshallers.
Method Summary | |
---|---|
static ByteInput |
createByteInput(ByteBuffer buffer)
Create a ByteInput wrapper for a ByteBuffer . |
static ByteInput |
createByteInput(InputStream inputStream)
Create a ByteInput wrapper for an InputStream . |
static ByteOutput |
createByteOutput(ByteBuffer buffer)
Create a ByteOutput wrapper for a ByteBuffer . |
static ByteOutput |
createByteOutput(OutputStream outputStream)
Create a ByteOutput wrapper for an OutputStream . |
static InputStream |
createInputStream(ByteInput byteInput)
Create an InputStream wrapper for a ByteInput . |
static OptionalDataException |
createOptionalDataException(boolean eof)
Construct a new OptionalDataException . |
static OptionalDataException |
createOptionalDataException(int length)
Construct a new OptionalDataException . |
static OutputStream |
createOutputStream(ByteOutput byteOutput)
Create a OutputStream wrapper for a ByteOutput . |
static MarshallerFactory |
getMarshallerFactory(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(String name,
ClassLoader classLoader)
Get a marshaller factory, by name. |
static MarshallerFactory |
getProvidedMarshallerFactory(String name)
Get a marshaller factory which is visible to this implementation, by 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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
@Deprecated public static MarshallerFactory getMarshallerFactory(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 acquire
null
if no matching factory was foundServiceLoader
public static MarshallerFactory getMarshallerFactory(String name, ClassLoader classLoader)
name
- the name of the protocol to acquireclassLoader
- the class loader to use
null
if no matching factory was foundServiceLoader
public static MarshallerFactory getProvidedMarshallerFactory(String name)
name
- the name of the protocol to acquire
null
if no matching factory was foundpublic static StreamHeader nullStreamHeader()
public static StreamHeader streamHeader(byte[] headerBytes)
headerBytes
- the header bytes
public static void readFully(ByteInput input, byte[] dest) throws IOException
ByteInput
. Fully fills in the array.
input
- the inputdest
- the destination
EOFException
- if the end of file is reached before the array is filled
IOException
- if an I/O error occurspublic static void readFully(ByteInput input, byte[] dest, int offs, int len) throws IOException
ByteInput
. Fully fills in len
bytes in the array.
input
- the inputdest
- the destinationoffs
- the offset into the arraylen
- the number of bytes
EOFException
- if the end of file is reached before the array is filled
IOException
- if an I/O error occurspublic static ByteInput createByteInput(ByteBuffer buffer)
ByteInput
wrapper for a ByteBuffer
.
buffer
- the byte buffer
public static ByteInput createByteInput(InputStream inputStream)
ByteInput
wrapper for an InputStream
.
inputStream
- the input stream
public static InputStream createInputStream(ByteInput byteInput)
InputStream
wrapper for a ByteInput
.
byteInput
- the byte input
public static ByteOutput createByteOutput(ByteBuffer buffer)
ByteOutput
wrapper for a ByteBuffer
.
buffer
- the byte buffer
public static ByteOutput createByteOutput(OutputStream outputStream)
ByteOutput
wrapper for an OutputStream
.
outputStream
- the output stream
public static OutputStream createOutputStream(ByteOutput byteOutput)
OutputStream
wrapper for a ByteOutput
.
byteOutput
- the byte output
public static ClassExternalizerFactory nullClassExternalizerFactory()
public static ObjectResolver nullObjectResolver()
public static ObjectTable nullObjectTable()
public static ClassTable nullClassTable()
public static 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 stream
public static 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 buffer
public static Externalizer nullExternalizer()
ObjectTable
entries.
This externalizer reads and writes no data.
|
JBoss Marshalling 1.3.0.CR9 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |