|
|||||||||
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. |
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). |
boolean |
isLittleEndian()
Returns true if this marshaller is little-endian, false otherwise. |
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(Object obj)
Writes an object reference in the marshaller. |
void |
writeShort(short i)
Writes a short. |
void |
writeString16(String s)
Writes a string of 16 bits chars. |
void |
writeString8(String s)
Writes a string of 8 bits chars. |
void |
writeValue(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 org.objectweb.jonathan.apis.kernel.JonathanException
b
- a byte;
org.objectweb.jonathan.apis.kernel.JonathanException
- if a marshal error occurred.void writeBoolean(boolean b) throws org.objectweb.jonathan.apis.kernel.JonathanException
b
- a boolean;
org.objectweb.jonathan.apis.kernel.JonathanException
- if a marshal error occurred.void writeChar8(char i) throws org.objectweb.jonathan.apis.kernel.JonathanException
The method used to translate the provided char
into an 8 bits
entity is not specified.
i
- a char;
org.objectweb.jonathan.apis.kernel.JonathanException
- if a marshal error occurred.void writeChar16(char i) throws org.objectweb.jonathan.apis.kernel.JonathanException
i
- a char;
org.objectweb.jonathan.apis.kernel.JonathanException
- if a marshal error occurred.void writeShort(short i) throws org.objectweb.jonathan.apis.kernel.JonathanException
i
- a short;
org.objectweb.jonathan.apis.kernel.JonathanException
- if a marshal error occurred.void writeInt(int i) throws org.objectweb.jonathan.apis.kernel.JonathanException
i
- an int;
org.objectweb.jonathan.apis.kernel.JonathanException
- if a marshal error occurred.void writeLong(long i) throws org.objectweb.jonathan.apis.kernel.JonathanException
i
- a long;
org.objectweb.jonathan.apis.kernel.JonathanException
- if a marshal error occurred.void writeFloat(float f) throws org.objectweb.jonathan.apis.kernel.JonathanException
f
- a float;
org.objectweb.jonathan.apis.kernel.JonathanException
- if a marshal error occurred.void writeDouble(double d) throws org.objectweb.jonathan.apis.kernel.JonathanException
d
- a double;
org.objectweb.jonathan.apis.kernel.JonathanException
- if a marshal error occurred.void writeString8(String s) throws org.objectweb.jonathan.apis.kernel.JonathanException
s
- a string;
org.objectweb.jonathan.apis.kernel.JonathanException
- if a marshal error occurred.void writeString16(String s) throws org.objectweb.jonathan.apis.kernel.JonathanException
s
- a string;
org.objectweb.jonathan.apis.kernel.JonathanException
- if a marshal error occurred.void writeReference(Object obj) throws org.objectweb.jonathan.apis.kernel.JonathanException
obj
- an object reference
org.objectweb.jonathan.apis.kernel.JonathanException
- if a marshal error occurred.void writeValue(Object obj) throws org.objectweb.jonathan.apis.kernel.JonathanException
obj
- an object
org.objectweb.jonathan.apis.kernel.JonathanException
- if a marshal error occurred.void writeByteArray(byte[] array, int offset, int length) throws org.objectweb.jonathan.apis.kernel.JonathanException
array
- an array of bytes;
org.objectweb.jonathan.apis.kernel.JonathanException
- if a marshal error occurred.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.org.objectweb.jonathan.apis.kernel.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 |