|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.OutputStream
org.ipdr.xdr.XDRMarshaller
public class XDRMarshaller
This class will write object to OutputStream in the XDR format.
Field Summary | |
---|---|
protected static byte |
FALSE
Byte containing FALSE value |
protected java.lang.String |
ipdrVersion_
String containing IPDR Version |
protected java.io.OutputStream |
targetStream_
To store the object of the Output Stream |
protected static byte |
TRUE
Byte containing TRUE value |
Constructor Summary | |
---|---|
XDRMarshaller(java.io.OutputStream os)
Constructor for the XDRMarshaller object. |
Method Summary | |
---|---|
void |
close()
Method to close the output stream. |
static void |
displayByteArray(byte[] byteArray)
A simple utility to format a byte array in hexadecimal for easy inspection. |
void |
flush()
Method to flush the output stream. |
java.lang.String |
getVersion()
Method to get the IPDR Version. |
static void |
main(java.lang.String[] args)
Simple demonstration entry point. |
void |
setVersion(java.lang.String ver)
Method to set the IPDR Version. |
void |
write_boolean(boolean b)
Method to write a 'boolean' to the output stream. |
void |
write_byte(byte v)
Method to write a 'byte' to the output stream. |
void |
write_double(double v)
Method to write a 'double' to the output stream. |
void |
write_float(float v)
Method to write a 'float' to the output stream. |
void |
write_long(int v)
Method to write an 'int' to the output stream. |
void |
write_longlong(long v)
Method to write a 'long' to the output stream. |
void |
write_octet_array(byte[] array,
int off,
int len)
Method to write a 'octet array' to the output stream. |
void |
write_short(short v)
Method to write a 'short' to the output stream. |
void |
write_u_long(long v)
Method to write an 'unsigned int' to the output stream. |
void |
write_wstring(java.lang.String v)
Method to write a 'string' to the output stream. |
void |
write(int b)
Method to write a 'byte' to the output stream. |
Methods inherited from class java.io.OutputStream |
---|
write, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.io.OutputStream targetStream_
protected static final byte TRUE
protected static final byte FALSE
protected java.lang.String ipdrVersion_
Constructor Detail |
---|
public XDRMarshaller(java.io.OutputStream os)
os
- Output streamMethod Detail |
---|
public void setVersion(java.lang.String ver)
ver
- IPDR Version.public java.lang.String getVersion()
public void write(int b) throws java.io.IOException
write
in class java.io.OutputStream
b
- the 'byte' to write
java.io.IOException
- when an exception occurs while writingpublic void write_long(int v) throws java.io.IOException
v
- the 'int' to write
java.io.IOException
- when an exception occurs while writingpublic void write_u_long(long v) throws java.io.IOException
v
- the 'unsigned int' to write
java.io.IOException
- when an exception occurs while writingpublic void write_longlong(long v) throws java.io.IOException
v
- the 'long' to write
java.io.IOException
- when an exception occurs while writingpublic void write_float(float v) throws java.io.IOException
v
- the 'float' to write
java.io.IOException
- when an exception occurs while writingpublic void write_double(double v) throws java.io.IOException
v
- the 'double' to write
java.io.IOException
- when an exception occurs while writingpublic void write_octet_array(byte[] array, int off, int len) throws java.io.IOException
array
- the dataoff
- the start offset in the datalen
- the number of bytes to write
java.io.IOException
- when an exception occurs while writingpublic void write_wstring(java.lang.String v) throws java.io.IOException
http://www1.tip.nl/~t876506/utf8tbl.html
v
- the 'string' to write
java.io.IOException
- when an exception occurs while writingpublic void write_byte(byte v) throws java.io.IOException
v
- the 'byte' to write
java.io.IOException
- when an exception occurs while writingpublic void write_boolean(boolean b) throws java.io.IOException
b
- the 'boolean' to write
java.io.IOException
- when an exception occurs while writingpublic void write_short(short v) throws java.io.IOException
v
- the 'short' to write
java.io.IOException
- when an exception occurs while writingpublic void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException
- when an exception occurs while flushingpublic void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.OutputStream
java.io.IOException
- when an exception occurs while closingpublic static void main(java.lang.String[] args)
public static void displayByteArray(byte[] byteArray)
byteArray
- the byte array to write
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |