| java.lang.Object org.xsocket.DataConverter
DataConverter | final public class DataConverter (Code) | | a data converter utilities class
author: grro@xsocket.org |
Method Summary | |
public static ByteBuffer | toByteBuffer(String s, String encoding) | public static ByteBuffer | toByteBuffer(ByteBuffer[] buffers) | public static ByteBuffer | toByteBuffer(byte b) | public static ByteBuffer | toByteBuffer(byte[] bytes) | public static ByteBuffer | toByteBuffer(byte[] bytes, int offset, int length) | public static ByteBuffer | toByteBuffer(double d) | public static ByteBuffer | toByteBuffer(long l) | public static ByteBuffer | toByteBuffer(short s) | public static ByteBuffer | toByteBuffer(int i) | public static ByteBuffer[] | toByteBuffers(ByteBuffer[] srcs, int offset, int length) | public static byte[] | toBytes(List<ByteBuffer> buffers) | public static byte[] | toBytes(ByteBuffer[] buffers) | public static byte[] | toBytes(ByteBuffer buffer) | public static String | toFormatedBytesSize(long bytes) | public static String | toFormatedDate(long time) | public static String | toFormatedDuration(long duration) | public static String | toHexString(ByteBuffer buffer) | public static String | toHexString(byte[] buffers, int maxOutSize) | public static String | toHexString(List<ByteBuffer> buffers, int maxOutSize) | public static String | toHexString(ByteBuffer[] buffers, int maxOutSize) | public static String | toString(ByteBuffer buffer) | public static String | toString(ByteBuffer[] buffer) | public static String | toString(ByteBuffer buffer, String encoding) | public static String | toString(List<ByteBuffer> buffers) | public static String | toString(List<ByteBuffer> buffers, String encoding) | public static String | toString(ByteBuffer[] buffers, String encoding) | public static String | toString(ByteBuffer[] buffers, String encoding, int maxOutSize) | public static String | toTextAndHexString(ByteBuffer[] buffers, String encoding, int maxOutSize) | public static String | toTextOrHexString(ByteBuffer buffer, String encoding, int maxOutSize) | public static String | toTextOrHexString(ByteBuffer[] buffers, String encoding, int maxOutSize) | public static long | unsignedIntToLong(int i) | public static int | unsignedLongToInt(Long l) |
toByteBuffer | public static ByteBuffer toByteBuffer(String s, String encoding)(Code) | | converts the given String into a ByteBuffer
Parameters: s - the String to convert Parameters: encoding - the encoding to use the String as ByteBuffer |
toByteBuffer | public static ByteBuffer toByteBuffer(ByteBuffer[] buffers)(Code) | | merges a ByteBuffer array into a (direct) ByteBuffer
Parameters: buffers - the ByteBuffer array to merge the single ByteBuffer |
toByteBuffer | public static ByteBuffer toByteBuffer(byte b)(Code) | | converts a single byte to a byte buffer
Parameters: b - the byte the ByteBuffer which contains the single byte |
toByteBuffer | public static ByteBuffer toByteBuffer(byte[] bytes)(Code) | | converts a byte array to a byte buffer
Parameters: bytes - the byte array the ByteBuffer which contains the bytes |
toByteBuffer | public static ByteBuffer toByteBuffer(byte[] bytes, int offset, int length)(Code) | | converts a byte array to a byte buffer
Parameters: bytes - the bytes Parameters: offset - the offset Parameters: length - the length the ByteBuffer which contains the single byte |
toByteBuffer | public static ByteBuffer toByteBuffer(double d)(Code) | | converts a double to a byte buffer
Parameters: d - the double the ByteBuffer which contains the double |
toByteBuffer | public static ByteBuffer toByteBuffer(long l)(Code) | | converts a long to a byte buffer
Parameters: l - the long the ByteBuffer which contains the long |
toByteBuffer | public static ByteBuffer toByteBuffer(short s)(Code) | | converts a short to a byte buffer
Parameters: s - the short the ByteBuffer which contains the short |
toByteBuffer | public static ByteBuffer toByteBuffer(int i)(Code) | | converts a integer to a byte buffer
Parameters: i - the int the ByteBuffer which contains the int |
toByteBuffers | public static ByteBuffer[] toByteBuffers(ByteBuffer[] srcs, int offset, int length)(Code) | | copies a array of ByteBuffer based on offset length to a byte buffer array
Parameters: srcs - the buffers Parameters: offset - the offset Parameters: length - the length the ByteBuffer |
toBytes | public static byte[] toBytes(List<ByteBuffer> buffers)(Code) | | converts a list of ByteBuffer to a byte array
Parameters: buffers - the ByteBuffer list to convert the byte array |
toBytes | public static byte[] toBytes(ByteBuffer[] buffers)(Code) | | converts a ByteBuffer array to a byte array
Parameters: buffers - the ByteBuffer array to convert the byte array |
toBytes | public static byte[] toBytes(ByteBuffer buffer)(Code) | | converts a ByteBuffer into a byte array
Parameters: buffer - the ByteBuffer to convert the byte array |
toFormatedBytesSize | public static String toFormatedBytesSize(long bytes)(Code) | | converts the given byte size in a textual representation
Parameters: bytes - the bytes to convert the formated String representation of the bytes |
toFormatedDate | public static String toFormatedDate(long time)(Code) | | converts the given time in a textual representation
Parameters: time - the time to convert the formated String representation of the date |
toFormatedDuration | public static String toFormatedDuration(long duration)(Code) | | converts the given duration in a textual representation
Parameters: duration - the duration to convert the formated String representation of the duration |
toHexString | public static String toHexString(ByteBuffer buffer)(Code) | | converts the given ByteBuffer into a hex string
Parameters: buffer - the ByteBuffer to convert the hex string |
toHexString | public static String toHexString(byte[] buffers, int maxOutSize)(Code) | | print the byte array as a hex string
Parameters: buffers - the buffers to print Parameters: maxOutSize - the max size to print the ByteBuffers as hex representation |
toHexString | public static String toHexString(List<ByteBuffer> buffers, int maxOutSize)(Code) | | print the byte buffer as a hex string
Parameters: buffers - the buffers to print Parameters: maxOutSize - the max size to print the ByteBuffers as hex representation |
toHexString | public static String toHexString(ByteBuffer[] buffers, int maxOutSize)(Code) | | print the byte buffer as a hex string
Parameters: buffers - the buffers to print Parameters: maxOutSize - the max size to print the ByteBuffers as hex representation |
toString | public static String toString(ByteBuffer buffer) throws UnsupportedEncodingException(Code) | | converts the given ByteBuffer into String by using
UTF-8 encoding
Parameters: buffer - the ByteBuffer to convert the ByteByuffer as String |
toString | public static String toString(ByteBuffer[] buffer) throws UnsupportedEncodingException(Code) | | converts the given ByteBuffer array into String by using
UTF-8 encoding
Parameters: buffer - the ByteBuffer arrayto convert the ByteByuffer as String |
toString | public static String toString(ByteBuffer buffer, String encoding) throws UnsupportedEncodingException(Code) | | converts the given ByteBuffer into String repesentation
Parameters: buffer - the ByteBuffer to convert Parameters: encoding - the encoding to use the ByteByuffer as String |
toString | public static String toString(List<ByteBuffer> buffers) throws UnsupportedEncodingException(Code) | | converts the given list of ByteBuffers into a String by using UTF-8 encoding
Parameters: buffers - the list of ByteBuffer to convert the ByteByuffer as String |
toString | public static String toString(List<ByteBuffer> buffers, String encoding) throws UnsupportedEncodingException(Code) | | converts the given list of ByteBuffers into a String
Parameters: buffers - the list of ByteBuffer to convert Parameters: encoding - the encoding to use the ByteByuffer as String |
toString | public static String toString(ByteBuffer[] buffers, String encoding) throws UnsupportedEncodingException(Code) | | converts the given array of ByteBuffers into String
Parameters: buffers - the array of ByteBuffer to convert Parameters: encoding - the encoding to use the ByteByuffer as String |
toString | public static String toString(ByteBuffer[] buffers, String encoding, int maxOutSize) throws UnsupportedEncodingException(Code) | | print the bytebuffer as limited string
Parameters: buffers - the buffers to print Parameters: encoding - the encoding to use Parameters: maxOutSize - the max size to print the ByteBuffers as string representation |
toTextAndHexString | public static String toTextAndHexString(ByteBuffer[] buffers, String encoding, int maxOutSize)(Code) | | |
toTextOrHexString | public static String toTextOrHexString(ByteBuffer buffer, String encoding, int maxOutSize)(Code) | | convert the ByteBuffer into a hex or text string (deping on content)
Parameters: buffer - the buffers to print Parameters: maxOutSize - the max size to print Parameters: encoding - the encoding to use the converted ByteBuffer |
toTextOrHexString | public static String toTextOrHexString(ByteBuffer[] buffers, String encoding, int maxOutSize)(Code) | | convert the ByteBuffer array into a hex or text string (deping on content)
Parameters: buffers - the buffers to print Parameters: maxOutSize - the max size to print Parameters: encoding - the encoding to use the converted ByteBuffer |
unsignedIntToLong | public static long unsignedIntToLong(int i)(Code) | | converts a unsigned int to a long by considering the overflow
Parameters: i - the integer value the long value |
unsignedLongToInt | public static int unsignedLongToInt(Long l)(Code) | | converts a unsigned long to a integer by considering the overflow
Parameters: l - the long value the int value |
|
|