com.sap.ip.me.api.pios.util
Class Bytes

java.lang.Object
  extended bycom.sap.ip.me.api.pios.util.Bytes

public final class Bytes
extends java.lang.Object

Used to convert a byte array to an ASCII or UNICODE string.

Since:
MI 2.5
Author:
Abaco

Method Summary
static java.lang.String getStringFromCharArray(byte[] data, int offset, boolean doubleByte)
          Returns a string from a char array.
static short swapBytes(short value)
          Swaps the bytes from a word (short).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

swapBytes

public static short swapBytes(short value)
Swaps the bytes from a word (short).

Parameters:
value - short value
Returns:
Returns the short with the hi and lo bytes swapped.

getStringFromCharArray

public static java.lang.String getStringFromCharArray(byte[] data,
                                                      int offset,
                                                      boolean doubleByte)
Returns a string from a char array.

Parameters:
data - the byte array to be converted to a string
offset - the offset of the data to convert
doubleByte - true if the bytes should be interpreted as a unicode string false otherwise
Returns:
A string representing the specified char array.


Copyright © 2005 SAP AG. All Rights Reserved.