org.simantics.databoard.util.binary
Class Endian

java.lang.Object
  extended by org.simantics.databoard.util.binary.Endian

Deprecated.

public class Endian
extends java.lang.Object

DataInput and DataOutput serialize primitive numbers with big endian byte order. This utility absolutely does nothing but facades byte operations.

Author:
Toni Kalajainen

Constructor Summary
Endian()
          Deprecated.  
 
Method Summary
static int getDynamicUInt32Length(int length)
          Deprecated. Get number of bytes for dynamic encoding of UInt32 (1-5 bytes)
static int getUInt(java.io.DataInput in, int maxValue)
          Deprecated. Decode an unsigned integer.
static int getUIntLength(int maxValue)
          Deprecated. Calculate unsigned integer encoding length.
static void putUInt(java.io.DataOutput out, int value, int maxValue)
          Deprecated. Encode and write an unsigned integer.
static double readDouble(java.io.DataInput in)
          Deprecated.  
static int readDynamicUInt32(java.io.DataInput in)
          Deprecated.  
static float readFloat(java.io.DataInput in)
          Deprecated.  
static int readInt(java.io.DataInput in)
          Deprecated.  
static long readLong(java.io.DataInput in)
          Deprecated.  
static short readShort(java.io.DataInput in)
          Deprecated.  
static int readUInt24(java.io.DataInput in)
          Deprecated.  
static int readUnsignedShort(java.io.DataInput in)
          Deprecated.  
static void writeDouble(java.io.DataOutput out, double d)
          Deprecated.  
static void writeDynamicUInt32(java.io.DataOutput out, int length)
          Deprecated. Write UInt32 with dynamic encoding (1-5 bytes).
static void writeFloat(java.io.DataOutput out, float v)
          Deprecated.  
static void writeInt(java.io.DataOutput out, int v)
          Deprecated.  
static void writeLong(java.io.DataOutput out, long v)
          Deprecated.  
static void writeShort(java.io.DataOutput out, int v)
          Deprecated.  
static void writeUInt24(java.io.DataOutput out, int value)
          Deprecated.  
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Endian

public Endian()
Deprecated. 
Method Detail

readShort

public static short readShort(java.io.DataInput in)
                       throws java.io.IOException
Deprecated. 
Throws:
java.io.IOException

writeShort

public static void writeShort(java.io.DataOutput out,
                              int v)
                       throws java.io.IOException
Deprecated. 
Throws:
java.io.IOException

readUnsignedShort

public static int readUnsignedShort(java.io.DataInput in)
                             throws java.io.IOException
Deprecated. 
Throws:
java.io.IOException

readInt

public static int readInt(java.io.DataInput in)
                   throws java.io.IOException
Deprecated. 
Throws:
java.io.IOException

writeInt

public static void writeInt(java.io.DataOutput out,
                            int v)
                     throws java.io.IOException
Deprecated. 
Throws:
java.io.IOException

readLong

public static long readLong(java.io.DataInput in)
                     throws java.io.IOException
Deprecated. 
Throws:
java.io.IOException

writeLong

public static void writeLong(java.io.DataOutput out,
                             long v)
                      throws java.io.IOException
Deprecated. 
Throws:
java.io.IOException

readDouble

public static double readDouble(java.io.DataInput in)
                         throws java.io.IOException
Deprecated. 
Throws:
java.io.IOException

writeDouble

public static void writeDouble(java.io.DataOutput out,
                               double d)
                        throws java.io.IOException
Deprecated. 
Throws:
java.io.IOException

readFloat

public static float readFloat(java.io.DataInput in)
                       throws java.io.IOException
Deprecated. 
Throws:
java.io.IOException

writeFloat

public static void writeFloat(java.io.DataOutput out,
                              float v)
                       throws java.io.IOException
Deprecated. 
Throws:
java.io.IOException

writeUInt24

public static void writeUInt24(java.io.DataOutput out,
                               int value)
                        throws java.io.IOException
Deprecated. 
Throws:
java.io.IOException

readUInt24

public static int readUInt24(java.io.DataInput in)
                      throws java.io.IOException
Deprecated. 
Throws:
java.io.IOException

writeDynamicUInt32

public static void writeDynamicUInt32(java.io.DataOutput out,
                                      int length)
                               throws java.io.IOException
Deprecated. 
Write UInt32 with dynamic encoding (1-5 bytes).

Parameters:
out -
length -
Throws:
java.io.IOException

readDynamicUInt32

public static int readDynamicUInt32(java.io.DataInput in)
                             throws java.io.IOException
Deprecated. 
Throws:
java.io.IOException

getDynamicUInt32Length

public static int getDynamicUInt32Length(int length)
Deprecated. 
Get number of bytes for dynamic encoding of UInt32 (1-5 bytes)

Parameters:
length - length value
Returns:
bytes required (1-5)

getUInt

public static int getUInt(java.io.DataInput in,
                          int maxValue)
                   throws java.io.IOException
Deprecated. 
Decode an unsigned integer. The number of bytes read depends on maxValue.

Parameters:
in -
maxValue -
Returns:
int
Throws:
java.io.IOException

getUIntLength

public static int getUIntLength(int maxValue)
Deprecated. 
Calculate unsigned integer encoding length.

Parameters:
maxValue -
Returns:
0-4 bytes

putUInt

public static void putUInt(java.io.DataOutput out,
                           int value,
                           int maxValue)
                    throws java.io.IOException
Deprecated. 
Encode and write an unsigned integer. The number of bytes written depends on the maxValue.

Parameters:
out -
value -
maxValue -
Throws:
java.io.IOException