|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ohrasys.cad.gds.GDSByteConverter
public class GDSByteConverter
A utility to convert byte arrays into java types and vice versa.
| Constructor Summary | |
|---|---|
GDSByteConverter()
|
|
| Method Summary | |
|---|---|
static java.io.ByteArrayOutputStream |
fromByte(byte data,
java.io.ByteArrayOutputStream baos)
Appends a java byte onto the ByteArrayOutputStream |
static java.io.ByteArrayOutputStream |
fromDouble(double data,
java.io.ByteArrayOutputStream baos)
Appends a java double onto the ByteArrayOutputStream |
static java.io.ByteArrayOutputStream |
fromFloat(float data,
java.io.ByteArrayOutputStream baos)
Appends a java float onto the ByteArrayOutputStream |
static java.io.ByteArrayOutputStream |
fromInt(int data,
java.io.ByteArrayOutputStream baos)
Appends a java int onto the ByteArrayOutputStream |
static java.io.ByteArrayOutputStream |
fromLong(long data,
java.io.ByteArrayOutputStream baos)
Appends a java long onto the ByteArrayOutputStream |
static java.io.ByteArrayOutputStream |
fromShort(short data,
java.io.ByteArrayOutputStream baos)
Appends a java short onto the ByteArrayOutputStream |
static byte |
readByte(java.io.InputStream in)
Converts a byte array from the input stream into an equivalent byte. |
static double |
readDouble(java.io.InputStream in)
Converts a byte array from the input stream into an equivalent double. |
static float |
readFloat(java.io.InputStream in)
Converts a byte array from the input stream into an equivalent float. |
static int |
readInt(java.io.InputStream in)
Converts a byte array from the input stream into an equivalent int. |
static long |
readLong(java.io.InputStream in)
Converts a byte array from the input stream into an equivalent long. |
static short |
readShort(java.io.InputStream in)
Converts a byte array from the input stream into an equivalent short. |
static byte |
toByte(byte[] bytes)
Converts the byte array representation of the byte to an equivalent byte. |
static double |
toDouble(byte[] bytes)
Converts the byte array representation of the double to an equivalent double. |
static float |
toFloat(byte[] bytes)
Converts the byte array representation of the float to an equivalent float. |
static int |
toInt(byte[] bytes)
Converts the byte array representation of the int to an equivalent int. |
static long |
toLong(byte[] bytes)
Converts the byte array representation of the long to an equivalent long. |
static short |
toShort(byte[] bytes)
Converts the byte array representation of the short to an equivalent short. |
java.lang.String |
toString()
Returns a string representation of this class |
static byte[] |
writeByte(byte data)
Converts a java byte into an equivalent byte array representation. |
static byte[] |
writeDouble(double data)
Converts a java double into an equivalent byte array representation. |
static byte[] |
writeFloat(float data)
Converts a java float into an equivalent byte array representation. |
static byte[] |
writeInt(int data)
Converts a java int into an equivalent byte array representation. |
static byte[] |
writeLong(long data)
Converts a java long into an equivalent byte array representation. |
static byte[] |
writeShort(short data)
Converts a java short into an equivalent byte array representation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public GDSByteConverter()
| Method Detail |
|---|
public static java.io.ByteArrayOutputStream fromByte(byte data,
java.io.ByteArrayOutputStream baos)
ByteArrayOutputStream
data - The data to write.baos - The ByteArrayOutputStream
public static java.io.ByteArrayOutputStream fromDouble(double data,
java.io.ByteArrayOutputStream baos)
ByteArrayOutputStream
data - The data to write.baos - The ByteArrayOutputStream
public static java.io.ByteArrayOutputStream fromFloat(float data,
java.io.ByteArrayOutputStream baos)
ByteArrayOutputStream
data - The data to write.baos - The ByteArrayOutputStream
public static java.io.ByteArrayOutputStream fromInt(int data,
java.io.ByteArrayOutputStream baos)
ByteArrayOutputStream
data - The data to write.baos - The ByteArrayOutputStream
public static java.io.ByteArrayOutputStream fromLong(long data,
java.io.ByteArrayOutputStream baos)
ByteArrayOutputStream
data - The data to write.baos - The ByteArrayOutputStream
public static java.io.ByteArrayOutputStream fromShort(short data,
java.io.ByteArrayOutputStream baos)
ByteArrayOutputStream
data - The data to write.baos - The ByteArrayOutputStream
public static byte readByte(java.io.InputStream in)
throws java.lang.NumberFormatException
in - The input stream from which to read.
java.lang.NumberFormatException - If the an error in processing occurs.
public static double readDouble(java.io.InputStream in)
throws java.lang.NumberFormatException
in - The input stream from which to read.
java.lang.NumberFormatException - If the an error in processing occurs.
public static float readFloat(java.io.InputStream in)
throws java.lang.NumberFormatException
in - The input stream from which to read.
java.lang.NumberFormatException - If the an error in processing occurs.
public static int readInt(java.io.InputStream in)
throws java.lang.NumberFormatException
in - The input stream from which to read.
java.lang.NumberFormatException - If the an error in processing occurs.
public static long readLong(java.io.InputStream in)
throws java.lang.NumberFormatException
in - The input stream from which to read.
java.lang.NumberFormatException - If the an error in processing occurs.
public static short readShort(java.io.InputStream in)
throws java.lang.NumberFormatException
in - The input stream from which to read.
java.lang.NumberFormatException - If the an error in processing occurs.
public static byte toByte(byte[] bytes)
throws java.lang.NumberFormatException
bytes - The byte representation of the byte.
java.lang.NumberFormatException - If the an error in processing occurs.
public static double toDouble(byte[] bytes)
throws java.lang.NumberFormatException
bytes - The byte representation of the double.
java.lang.NumberFormatException - If the an error in processing occurs.
public static float toFloat(byte[] bytes)
throws java.lang.NumberFormatException
bytes - The byte representation of the float.
java.lang.NumberFormatException - If the an error in processing occurs.
public static int toInt(byte[] bytes)
throws java.lang.NumberFormatException
bytes - The byte representation of the int.
java.lang.NumberFormatException - If the an error in processing occurs.
public static long toLong(byte[] bytes)
throws java.lang.NumberFormatException
bytes - The byte representation of the long.
java.lang.NumberFormatException - If the an error in processing occurs.
public static short toShort(byte[] bytes)
throws java.lang.NumberFormatException
bytes - The byte representation of the short.
java.lang.NumberFormatException - If the an error in processing occurs.public static byte[] writeByte(byte data)
data - The data to convert.
public static byte[] writeDouble(double data)
data - The data to convert.
public static byte[] writeFloat(float data)
data - The data to convert.
public static byte[] writeInt(int data)
data - The data to convert.
public static byte[] writeLong(long data)
data - The data to convert.
public static byte[] writeShort(short data)
data - The data to convert.
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||