org.jsmpp.util
Class OctetUtil

java.lang.Object
  extended by org.jsmpp.util.OctetUtil

public class OctetUtil
extends java.lang.Object

The octet util.

Version:
1.0, 1.0
Author:
uudashr

Constructor Summary
OctetUtil()
           
 
Method Summary
static int bytesToInt(byte[] bytes)
          32 bit.
static int bytesToInt(byte[] bytes, int offset)
          32 bit.
static short bytesToShort(byte[] bytes)
          16 bit.
static short bytesToShort(byte[] bytes, int offset)
          16 bit.
static byte[] intToBytes(int value)
          Convert integer (4 octets) value to bytes.
static byte[] shortToBytes(short value)
          Convert integer (2 octets) value to bytes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OctetUtil

public OctetUtil()
Method Detail

intToBytes

public static byte[] intToBytes(int value)
Convert integer (4 octets) value to bytes.

Parameters:
value - as 4 bytes representing integer in bytes.
Returns:

shortToBytes

public static byte[] shortToBytes(short value)
Convert integer (2 octets) value to bytes.

Parameters:
value -
Returns:

bytesToInt

public static int bytesToInt(byte[] bytes)
32 bit.

Parameters:
bytes -
Returns:

bytesToInt

public static int bytesToInt(byte[] bytes,
                             int offset)
32 bit.

Parameters:
bytes -
offset -
Returns:

bytesToShort

public static short bytesToShort(byte[] bytes)
16 bit.

Parameters:
bytes -
Returns:

bytesToShort

public static short bytesToShort(byte[] bytes,
                                 int offset)
16 bit.

Parameters:
bytes -
offset -
Returns: