|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.io.OutputStream
org.omg.CORBA.portable.OutputStream
org.omg.CORBA_2_3.portable.OutputStream
org.objectweb.david.apis.presentation.DavidOutputStream
org.objectweb.david.libs.presentation.portable.PortableMarshallerFactory.PortableMarshaller
PortableMarshaller is an (abstract) implementation of Marshaller.
| Field Summary | |
static int |
CHUNKS
|
static int |
CODEBASE
|
protected Chunk |
current
The current chunk in the message, i.e., the one data are written to. |
protected int |
encapsulation_start
|
protected Chunk |
first
The first chunk in the message. |
static int |
INDIRECTION_TAG
|
static int |
MULTIPLE_TYPES
|
static int |
NULL_TAG
|
protected int |
offset
The offset of the first writable byte in current. |
protected int |
prev_size
prev_size is such that prev_size + offset = the current
offset in the whole message. |
static int |
SINGLE_TYPE
|
protected int |
top
The offset of the first non-writable byte in current. |
static int |
VALUE_TAG
|
| Constructor Summary | |
PortableMarshallerFactory.PortableMarshaller()
Builds a new marshaller. |
|
| Method Summary | |
void |
close()
Closes the stream. |
org.omg.CORBA.portable.InputStream |
create_input_stream()
|
void |
endEncapsulation(int previous_encapsulation_start)
|
org.objectweb.jonathan.apis.kernel.Context |
getContext()
Returns a Context associated with this marshaller. |
int |
getOffset()
Returns the current offset in the message, i.e., the position in the message at which the next byte will be written. |
Chunk |
getState()
Returns the state of the message as a (chain of) chunk(s). |
org.omg.CORBA.ORB |
orb()
|
java.io.OutputStream |
outputStream()
Returns an output stream to write into the message. |
protected void |
prepare()
When offset is equal to top, this method is
% called to get a new chunk to write to. |
void |
reset()
This method causes the message to lose all its references to the underlying chunks, without releasing
them. |
boolean |
sameContents(Marshaller other)
Checks if the target marshaller and the provided one have the same contents, i.e., they contain the same bits. |
void |
setOffset(int off)
Sets the offset in the message. |
int |
startEncapsulation()
|
void |
write_abstract_interface(java.lang.Object value)
|
void |
write_Abstract(java.lang.Object value)
|
void |
write_any_array(org.omg.CORBA.Any[] seq,
int offset,
int length)
|
void |
write_any(org.omg.CORBA.Any value)
|
void |
write_boolean_array(boolean[] array,
int off,
int len)
|
void |
write_boolean(boolean value)
|
void |
write_char_array(char[] array,
int off,
int len)
|
void |
write_char(char value)
|
void |
write_double(double value)
|
void |
write_float(float value)
|
void |
write_long(int value)
|
void |
write_longdouble(double value)
|
void |
write_longlong(long value)
|
void |
write_Object(org.omg.CORBA.Object value)
Method used by stubs when they need to send interfaces references. |
void |
write_octet_array(byte[] array,
int off,
int len)
|
void |
write_octet(byte value)
|
void |
write_short(short value)
|
void |
write_string(java.lang.String value)
|
void |
write_TypeCode(org.omg.CORBA.TypeCode value)
|
void |
write_ulong(int value)
|
void |
write_ulonglong(long value)
|
void |
write_ushort(short value)
|
void |
write_value(java.io.Serializable value)
|
void |
write_Value(java.io.Serializable value)
|
void |
write_value(java.io.Serializable value,
org.omg.CORBA.portable.BoxedValueHelper factory)
|
void |
write_value(java.io.Serializable value,
java.lang.Class classe)
Marshals a value |
void |
write_value(java.io.Serializable value,
java.lang.String repository_id)
|
void |
write_wchar(char value)
|
void |
write_wstring(java.lang.String value)
|
void |
write(byte[] array,
int off,
int len)
Writes 'len' bytes from the specified byte array starting at offset 'off' to this output message. |
void |
write(Chunk chunk)
Writes a chunk in the message. |
void |
write(int b)
Writes the specified byte to this message. |
void |
writeBoolean(boolean v)
Writes a boolean in a message. |
void |
writeByte(byte v)
Writes a byte in a message. |
void |
writeByteArray(byte[] array,
int off,
int len)
Writes an array of bytes in a message. |
void |
writeChar8(char v)
Writes a char in a message. |
protected void |
writePadding(int constraint)
|
void |
writeReference(java.lang.Object value)
Method used by stubs when they need to send interfaces references. |
void |
writeString8(java.lang.String str)
Writes a string in a message. |
void |
writeValue(java.lang.Object value)
Writes a value in the marshaller. |
| Methods inherited from class org.objectweb.david.apis.presentation.DavidOutputStream |
_truncatable_ids, write_Principal |
| Methods inherited from class org.omg.CORBA.portable.OutputStream |
write_Context, write_double_array, write_fixed, write_float_array, write_long_array, write_longlong_array, write_short_array, write_ulong_array, write_ulonglong_array, write_ushort_array, write_wchar_array |
| Methods inherited from class java.io.OutputStream |
flush, write |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.objectweb.jonathan.apis.presentation.Marshaller |
isLittleEndian, writeChar16, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeString16 |
| Methods inherited from interface org.omg.CORBA.DataOutputStream |
write_double_array, write_float_array, write_long_array, write_longlong_array, write_short_array, write_ulong_array, write_ulonglong_array, write_ushort_array, write_wchar_array |
| Field Detail |
protected Chunk first
protected Chunk current
protected int offset
current.
protected int top
current.
protected int prev_size
offset = the current
offset in the whole message.
protected int encapsulation_start
public static final int NULL_TAG
public static final int VALUE_TAG
public static final int CODEBASE
public static final int SINGLE_TYPE
public static final int MULTIPLE_TYPES
public static final int CHUNKS
public static final int INDIRECTION_TAG
| Constructor Detail |
public PortableMarshallerFactory.PortableMarshaller()
| Method Detail |
public org.omg.CORBA.ORB orb()
public void write(Chunk chunk)
MarshallerThe target becomes the "owner" of the provided chunk, and therefore is not supposed to duplicate it. If the entity invoking this operation wants to keep a reference to the chunk, it must be duplicated.
write in interface Marshallerchunk - the chunk to be written.public Chunk getState()
Marshaller
The returned chunk(s) are NOT duplicated. If the caller keeps a
reference to them, it must reset the message, and not
continue to use it.
getState in interface Marshallerpublic int getOffset()
Marshaller
getOffset in interface Marshallerpublic void setOffset(int off)
MarshallerThis method may be used to override data already written into the message.
setOffset in interface Marshalleroff - the new offset.public void reset()
Marshallerreleasing
them. This method must not be used if no reference to chunks present in the
message is held by an entity in charge of their release. It also releases
the context associated with the target marshaller.
reset in interface Marshallerpublic void close()
DavidOutputStreamThis method has been added here to solve an exception conflict between OutputStream and Marshaller.
close in interface Marshallerclose in class DavidOutputStreampublic java.io.OutputStream outputStream()
Marshaller
outputStream in interface Marshallerpublic final boolean sameContents(Marshaller other)
Marshaller
sameContents in interface Marshallerother - a marshaller;
public void writeByte(byte v)
throws org.objectweb.jonathan.apis.kernel.JonathanException
writeByte in interface Marshallerv - a byte;
org.objectweb.jonathan.apis.kernel.JonathanException - if an error occurs.
public void writeBoolean(boolean v)
throws org.objectweb.jonathan.apis.kernel.JonathanException
writeBoolean in interface Marshallerv - a boolean;
org.objectweb.jonathan.apis.kernel.JonathanException - if an error occurs.
public void writeChar8(char v)
throws org.objectweb.jonathan.apis.kernel.JonathanException
writeChar8 in interface Marshallerv - a char;
org.objectweb.jonathan.apis.kernel.JonathanException - if an error occurs.
public void writeString8(java.lang.String str)
throws org.objectweb.jonathan.apis.kernel.JonathanException
writeString8 in interface Marshallerstr - a string;
org.objectweb.jonathan.apis.kernel.JonathanException - if an error occurs.public final void writeReference(java.lang.Object value)
writeReference in interface Marshallervalue - an object referencepublic final void writeValue(java.lang.Object value)
Marshaller
writeValue in interface Marshallervalue - an object
public void writeByteArray(byte[] array,
int off,
int len)
throws org.objectweb.jonathan.apis.kernel.JonathanException
writeByteArray in interface Marshallerarray - an array of bytes;
org.objectweb.jonathan.apis.kernel.JonathanException - if an error occurs.public org.omg.CORBA.portable.InputStream create_input_stream()
public final void write_boolean(boolean value)
write_boolean in interface org.omg.CORBA.DataOutputStreampublic final void write_char(char value)
write_char in interface org.omg.CORBA.DataOutputStreampublic final void write_wchar(char value)
write_wchar in interface org.omg.CORBA.DataOutputStreampublic final void write_octet(byte value)
write_octet in interface org.omg.CORBA.DataOutputStreampublic final void write_short(short value)
write_short in interface org.omg.CORBA.DataOutputStreampublic final void write_ushort(short value)
write_ushort in interface org.omg.CORBA.DataOutputStreampublic final void write_long(int value)
write_long in interface org.omg.CORBA.DataOutputStreampublic final void write_ulong(int value)
write_ulong in interface org.omg.CORBA.DataOutputStreampublic final void write_longlong(long value)
write_longlong in interface org.omg.CORBA.DataOutputStreampublic final void write_ulonglong(long value)
write_ulonglong in interface org.omg.CORBA.DataOutputStreampublic final void write_float(float value)
write_float in interface org.omg.CORBA.DataOutputStreampublic final void write_double(double value)
write_double in interface org.omg.CORBA.DataOutputStreampublic final void write_string(java.lang.String value)
write_string in interface org.omg.CORBA.DataOutputStreampublic final void write_wstring(java.lang.String value)
write_wstring in interface org.omg.CORBA.DataOutputStreampublic void write_Value(java.io.Serializable value)
write_Value in interface org.omg.CORBA.DataOutputStreamvalue - public void write_value(java.io.Serializable value)
public void write_value(java.io.Serializable value,
java.lang.String repository_id)
value -
public void write_value(java.io.Serializable value,
java.lang.Class classe)
value - classe -
public void write_value(java.io.Serializable value,
org.omg.CORBA.portable.BoxedValueHelper factory)
value - factory -
public final void write_boolean_array(boolean[] array,
int off,
int len)
write_boolean_array in interface org.omg.CORBA.DataOutputStream
public final void write_char_array(char[] array,
int off,
int len)
write_char_array in interface org.omg.CORBA.DataOutputStream
public final void write_octet_array(byte[] array,
int off,
int len)
write_octet_array in interface org.omg.CORBA.DataOutputStreampublic final void write_Object(org.omg.CORBA.Object value)
write_Object in interface org.omg.CORBA.DataOutputStreampublic final void write_TypeCode(org.omg.CORBA.TypeCode value)
write_TypeCode in interface org.omg.CORBA.DataOutputStreampublic final void write_any(org.omg.CORBA.Any value)
write_any in interface org.omg.CORBA.DataOutputStream
public final void write(int b)
throws java.io.IOException
This method calls the write(byte) method.
b - the byte.
java.io.IOException - if no buffer to write to could be obtained.
public final void write(byte[] array,
int off,
int len)
throws java.io.IOException
off - the start offset in the data.len - the number of bytes to write.
java.io.IOExceptionpublic final org.objectweb.jonathan.apis.kernel.Context getContext()
MarshallerContext associated with this marshaller.
getContext in interface MarshallerContext associated with this marshaller.
protected void prepare()
throws org.objectweb.jonathan.apis.kernel.JonathanException
offset is equal to top, this method is
% called to get a new chunk to write to.
org.objectweb.jonathan.apis.kernel.JonathanException - if something goes wrong.public void write_longdouble(double value)
write_longdouble in interface org.omg.CORBA.DataOutputStreampublic void write_abstract_interface(java.lang.Object value)
public void write_Abstract(java.lang.Object value)
write_Abstract in interface org.omg.CORBA.DataOutputStream
public void write_any_array(org.omg.CORBA.Any[] seq,
int offset,
int length)
write_any_array in interface org.omg.CORBA.DataOutputStream
public int startEncapsulation()
throws org.objectweb.jonathan.apis.kernel.JonathanException
startEncapsulation in class DavidOutputStreamorg.objectweb.jonathan.apis.kernel.JonathanException
public void endEncapsulation(int previous_encapsulation_start)
throws org.objectweb.jonathan.apis.kernel.JonathanException
endEncapsulation in class DavidOutputStreamorg.objectweb.jonathan.apis.kernel.JonathanException
protected void writePadding(int constraint)
throws org.objectweb.jonathan.apis.kernel.JonathanException
org.objectweb.jonathan.apis.kernel.JonathanException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||