public class MessageFormat extends java.lang.Object implements FormatReader, FormatWriter
| Constructor and Description |
|---|
MessageFormat()
Creates a new MessageOutput object.
|
MessageFormat(byte[] inBytes) |
MessageFormat(StreamBuffer inBuffer) |
| Modifier and Type | Method and Description |
|---|---|
StreamBuffer |
getBuffer() |
int |
getLength() |
boolean |
readBool() |
byte |
readByte() |
byte[] |
readBytes() |
double |
readDouble() |
<T extends java.lang.Enum<T>> |
readEnum(java.lang.Class<T> type) |
float |
readFloat() |
int |
readInt() |
long |
readLong() |
<T> T |
readObject(FormatUnmarshaller<T> type) |
java.lang.Object |
readObjectMarshalled() |
java.lang.Object |
readObjectSerialized() |
short |
readShort() |
java.lang.String |
readString() |
byte[] |
toByteArray()
Copy the internal buffers into a new byte array.
|
java.lang.String |
toString() |
void |
writeBool(boolean val)
Writes a boolean to the underlying buffer.
|
void |
writeByte(byte val)
Writes a byte to the underlying buffer.
|
void |
writeBytes(byte[] val)
Writes a byte array to the underlying buffer.
|
void |
writeBytesNoCopy(byte[] val)
Write the bytes to the final buffer.
|
void |
writeDouble(double val)
Writes a double to the underlying buffer.
|
<T extends java.lang.Enum<T>> |
writeEnum(T val)
Writes an enum to the underlying buffer.
|
void |
writeFloat(float val)
Writes a float to the underlying buffer.
|
void |
writeInt(int val)
Writes an integer to the underlying buffer.
|
void |
writeLong(long val)
Writes a long to the underlying buffer.
|
<T extends FormatMarshaller> |
writeObject(T val)
Writes an object to the underlying buffer.
|
void |
writeObjectMarshalled(java.lang.Object val)
Writes an object to the underlying buffer using an object marshaller.
|
void |
writeObjectSerialized(java.io.Serializable val)
Writes an object to the underlying buffer by serializing it.
|
void |
writeShort(short val)
Writes a short to the underlying buffer.
|
void |
writeString(java.lang.String val)
Writes a string to the underlying buffer.
|
public MessageFormat()
public MessageFormat(byte[] inBytes)
public MessageFormat(StreamBuffer inBuffer)
public byte[] toByteArray()
FormatWritertoByteArray in interface FormatWriterpublic int getLength()
public StreamBuffer getBuffer()
public void writeBool(boolean val)
throws FormatException
FormatWriterwriteBool in interface FormatWriterval - - The boolean to write.FormatException - If there was a problem while writing.public boolean readBool()
throws FormatException
readBool in interface FormatReaderFormatExceptionpublic void writeByte(byte val)
throws FormatException
FormatWriterwriteByte in interface FormatWriterval - - The short to write.FormatException - If there was a problem while writing.public byte readByte()
throws FormatException
readByte in interface FormatReaderFormatException - If there was a problem while reading.public void writeShort(short val)
throws FormatException
FormatWriterwriteShort in interface FormatWriterval - - The short to write.FormatException - If there was a problem while writing.public short readShort()
throws FormatException
readShort in interface FormatReaderFormatException - If there was a problem while reading.public void writeInt(int val)
throws FormatException
FormatWriterwriteInt in interface FormatWriterval - - The integer to write.FormatException - If there was a problem while writing.public int readInt()
throws FormatException
readInt in interface FormatReaderFormatException - If there was a problem while reading.public void writeLong(long val)
throws FormatException
FormatWriterwriteLong in interface FormatWriterval - - The double to write.FormatException - If there was a problem while writing.public long readLong()
throws FormatException
readLong in interface FormatReaderFormatException - If there was a problem while reading.public void writeFloat(float val)
FormatWriterwriteFloat in interface FormatWriterval - - the float to write.public float readFloat()
readFloat in interface FormatReaderpublic void writeDouble(double val)
throws FormatException
FormatWriterwriteDouble in interface FormatWriterval - - The double to write.FormatException - If there was a problem while writing.public double readDouble()
throws FormatException
readDouble in interface FormatReaderFormatException - If there was a problem while reading.public void writeString(java.lang.String val)
throws FormatException
FormatWriterwriteString in interface FormatWriterval - - The string to write.FormatException - If there was a problem while writing.public java.lang.String readString()
throws FormatException
readString in interface FormatReaderFormatException - If there was a problem while reading.public void writeBytes(byte[] val)
throws FormatException
FormatWriterwriteBytes in interface FormatWriterval - - The byte array to write.FormatException - If there was a problem while writing.public void writeBytesNoCopy(byte[] val)
throws FormatException
FormatWriterwriteBytesNoCopy in interface FormatWriterval - - The byte array to write.FormatException - If there was a problem while writing.public byte[] readBytes()
throws FormatException
readBytes in interface FormatReaderFormatException - If there was a problem while reading.public <T extends java.lang.Enum<T>> void writeEnum(T val)
throws FormatException
FormatWriterwriteEnum in interface FormatWriterval - - The enum to write.FormatException - If there was a problem while writing.public <T extends java.lang.Enum<T>> T readEnum(java.lang.Class<T> type)
throws FormatException
readEnum in interface FormatReadertype - The enum type;FormatException - If there was a problem while reading.public <T extends FormatMarshaller> void writeObject(T val) throws FormatException
FormatWriterwriteObject in interface FormatWriterval - - The object to write.FormatException - If there was a problem while writing.public <T> T readObject(FormatUnmarshaller<T> type) throws FormatException
readObject in interface FormatReaderFormatException - If there was a problem while reading.public void writeObjectMarshalled(java.lang.Object val)
throws FormatException
FormatWriterwriteObjectMarshalled in interface FormatWriterval - - The object to write.FormatException - If there was a problem while writing.public java.lang.Object readObjectMarshalled()
throws FormatException
readObjectMarshalled in interface FormatReaderFormatException - If there was a problem while reading.public void writeObjectSerialized(java.io.Serializable val)
throws FormatException
FormatWriterwriteObjectSerialized in interface FormatWriterval - - The object to write.FormatException - If there was a problem while writing.public java.lang.Object readObjectSerialized()
throws FormatException
readObjectSerialized in interface FormatReaderFormatException - If there was a problem while reading.public java.lang.String toString()
toString in class java.lang.Object