|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Marshaller
Marshaller is the type of basic types marshallers. They should be used by protocols.
| Method Summary | |
|---|---|
void |
close()
This method causes the message to lose all its references to the underlying chunks, and release each
of them. |
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). |
boolean |
isLittleEndian()
Returns true if this marshaller is little-endian, false otherwise. |
java.io.OutputStream |
outputStream()
Returns an output stream to write into the message. |
void |
reset()
This method causes the message to lose all its references to the underlying chunks, without releasing
them. |
boolean |
sameContents(Marshaller marshaller)
Checks if the target marshaller and the provided one have the same contents, i.e., they contain the same bits. |
void |
setOffset(int offset)
Sets the offset in the message. |
void |
write(Chunk chunk)
Writes a chunk in the message. |
void |
writeBoolean(boolean b)
Writes a boolean. |
void |
writeByte(byte b)
Writes a byte. |
void |
writeByteArray(byte[] array,
int offset,
int length)
Writes an array of bytes. |
void |
writeChar16(char i)
Writes a 16 bits char. |
void |
writeChar8(char i)
Writes an 8 bits char. |
void |
writeDouble(double d)
Writes a double. |
void |
writeFloat(float f)
Writes a float. |
void |
writeInt(int i)
Writes an int. |
void |
writeLong(long i)
Writes a long. |
void |
writeReference(java.lang.Object obj)
Writes an object reference in the marshaller. |
void |
writeShort(short i)
Writes a short. |
void |
writeString16(java.lang.String s)
Writes a string of 16 bits chars. |
void |
writeString8(java.lang.String s)
Writes a string of 8 bits chars. |
void |
writeValue(java.lang.Object obj)
Writes a value in the marshaller. |
| Method Detail |
|---|
void write(Chunk chunk)
The 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.
chunk - the chunk to be written.
void writeByte(byte b)
throws JonathanException
b - a byte;
JonathanException - if a marshal error occurred.
void writeBoolean(boolean b)
throws JonathanException
b - a boolean;
JonathanException - if a marshal error occurred.
void writeChar8(char i)
throws JonathanException
The method used to translate the provided char into an 8 bits
entity is not specified.
i - a char;
JonathanException - if a marshal error occurred.
void writeChar16(char i)
throws JonathanException
i - a char;
JonathanException - if a marshal error occurred.
void writeShort(short i)
throws JonathanException
i - a short;
JonathanException - if a marshal error occurred.
void writeInt(int i)
throws JonathanException
i - an int;
JonathanException - if a marshal error occurred.
void writeLong(long i)
throws JonathanException
i - a long;
JonathanException - if a marshal error occurred.
void writeFloat(float f)
throws JonathanException
f - a float;
JonathanException - if a marshal error occurred.
void writeDouble(double d)
throws JonathanException
d - a double;
JonathanException - if a marshal error occurred.
void writeString8(java.lang.String s)
throws JonathanException
s - a string;
JonathanException - if a marshal error occurred.
void writeString16(java.lang.String s)
throws JonathanException
s - a string;
JonathanException - if a marshal error occurred.
void writeReference(java.lang.Object obj)
throws JonathanException
obj - an object reference
JonathanException - if a marshal error occurred.
void writeValue(java.lang.Object obj)
throws JonathanException
obj - an object
JonathanException - if a marshal error occurred.
void writeByteArray(byte[] array,
int offset,
int length)
throws JonathanException
array - an array of bytes;offset - index of the first byte in array that must be written.length - number of bytes of array that must be written.
JonathanException - if a marshal error occurred.java.io.OutputStream outputStream()
boolean sameContents(Marshaller marshaller)
marshaller - a marshaller;
boolean isLittleEndian()
Chunk getState()
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.
int getOffset()
void setOffset(int offset)
This method may be used to override data already written into the message.
offset - the new offset.Context getContext()
Context associated with this marshaller.
Context associated with this marshaller.void reset()
releasing
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.
void close()
release each
of them. It also released the context.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||