|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xsocket.DataConverter
public final class DataConverter
a data converter utilities class
Constructor Summary | |
---|---|
DataConverter()
|
Method Summary | |
---|---|
static java.nio.ByteBuffer |
toByteBuffer(java.nio.ByteBuffer[] buffers)
merges a ByteBuffer array into a (direct) ByteBuffer |
static java.nio.ByteBuffer |
toByteBuffer(java.lang.String s,
java.lang.String encoding)
converts the given String into a ByteBuffer |
static byte[] |
toBytes(java.nio.ByteBuffer buffer)
converts a ByteBuffer into a byte array |
static byte[] |
toBytes(java.nio.ByteBuffer[] buffers)
converts a ByteBuffer array to a byte array |
static byte[] |
toBytes(java.util.List<java.nio.ByteBuffer> buffers)
converts a list of ByteBuffer to a byte array |
static java.lang.String |
toByteString(java.nio.ByteBuffer buffer)
converts the given ByteBuffer into a hex string |
static java.lang.String |
toFormatedBytesSize(long bytes)
converts the given byte size in a textual representation |
static java.lang.String |
toFormatedDate(long time)
converts the given time in a textual representation |
static java.lang.String |
toFormatedDuration(long duration)
converts the given duration in a textual representation |
static java.lang.String |
toHexString(byte[] buffers,
int maxOutSize)
print the byte array as a hex string |
static java.lang.String |
toHexString(java.nio.ByteBuffer[] buffers,
int maxOutSize)
print the bytebuffer as a hex string |
static java.lang.String |
toString(java.nio.ByteBuffer buffer)
converts the given ByteBuffer into String by using UTF-8 encoding |
static java.lang.String |
toString(java.nio.ByteBuffer[] buffer)
converts the given ByteBuffer array into String by using UTF-8 encoding |
static java.lang.String |
toString(java.nio.ByteBuffer[] buffers,
java.lang.String encoding)
converts the given array of ByteBuffers into String |
static java.lang.String |
toString(java.nio.ByteBuffer[] buffers,
java.lang.String encoding,
int maxOutSize)
print the bytebuffer as limited string |
static java.lang.String |
toString(java.nio.ByteBuffer buffer,
java.lang.String encoding)
converts the given ByteBuffer into String repesentation |
static java.lang.String |
toString(java.util.List<java.nio.ByteBuffer> buffers,
java.lang.String encoding)
converts the given list of ByteBuffers into a String |
static java.lang.String |
toTextAndHexString(java.nio.ByteBuffer[] buffers,
java.lang.String encoding,
int maxOutSize)
|
static java.lang.String |
toTextOrHexString(java.nio.ByteBuffer[] buffers,
java.lang.String encoding,
int maxOutSize)
convert the ByteBuffer array into a hex or text string (deping on content) |
static java.lang.String |
toTextOrHexString(java.nio.ByteBuffer buffer,
java.lang.String encoding,
int maxOutSize)
convert the ByteBuffer into a hex or text string (deping on content) |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DataConverter()
Method Detail |
---|
public static java.lang.String toFormatedBytesSize(long bytes)
bytes
- the bytes to convert
public static java.lang.String toFormatedDate(long time)
time
- the time to convert
public static java.lang.String toFormatedDuration(long duration)
duration
- the duration to convert
public static java.nio.ByteBuffer toByteBuffer(java.lang.String s, java.lang.String encoding)
s
- the String to convertencoding
- the encoding to use
public static java.lang.String toString(java.nio.ByteBuffer buffer) throws java.io.UnsupportedEncodingException
buffer
- the ByteBuffer to convert
java.io.UnsupportedEncodingException
public static java.lang.String toString(java.nio.ByteBuffer[] buffer) throws java.io.UnsupportedEncodingException
buffer
- the ByteBuffer arrayto convert
java.io.UnsupportedEncodingException
public static java.lang.String toString(java.nio.ByteBuffer buffer, java.lang.String encoding) throws java.io.UnsupportedEncodingException
buffer
- the ByteBuffer to convertencoding
- the encoding to use
java.io.UnsupportedEncodingException
public static java.lang.String toByteString(java.nio.ByteBuffer buffer)
buffer
- the ByteBuffer to convert
public static java.lang.String toString(java.util.List<java.nio.ByteBuffer> buffers, java.lang.String encoding) throws java.io.UnsupportedEncodingException
buffers
- the list of ByteBuffer to convertencoding
- the encoding to use
java.io.UnsupportedEncodingException
public static java.lang.String toString(java.nio.ByteBuffer[] buffers, java.lang.String encoding) throws java.io.UnsupportedEncodingException
buffers
- the array of ByteBuffer to convertencoding
- the encoding to use
java.io.UnsupportedEncodingException
public static java.lang.String toString(java.nio.ByteBuffer[] buffers, java.lang.String encoding, int maxOutSize) throws java.io.UnsupportedEncodingException
buffers
- the buffers to printencoding
- the encoding to usemaxOutSize
- the max size to print
java.io.UnsupportedEncodingException
public static java.nio.ByteBuffer toByteBuffer(java.nio.ByteBuffer[] buffers)
buffers
- the ByteBuffer array to merge
public static byte[] toBytes(java.util.List<java.nio.ByteBuffer> buffers)
buffers
- the ByteBuffer list to convert
public static byte[] toBytes(java.nio.ByteBuffer[] buffers)
buffers
- the ByteBuffer array to convert
public static byte[] toBytes(java.nio.ByteBuffer buffer)
buffer
- the ByteBuffer to convert
public static java.lang.String toHexString(byte[] buffers, int maxOutSize)
buffers
- the buffers to printmaxOutSize
- the max size to print
public static java.lang.String toHexString(java.nio.ByteBuffer[] buffers, int maxOutSize)
buffers
- the buffers to printmaxOutSize
- the max size to print
public static java.lang.String toTextOrHexString(java.nio.ByteBuffer buffer, java.lang.String encoding, int maxOutSize)
buffer
- the buffers to printmaxOutSize
- the max size to printencoding
- the encoding to use
public static java.lang.String toTextOrHexString(java.nio.ByteBuffer[] buffers, java.lang.String encoding, int maxOutSize)
buffers
- the buffers to printmaxOutSize
- the max size to printencoding
- the encoding to use
public static java.lang.String toTextAndHexString(java.nio.ByteBuffer[] buffers, java.lang.String encoding, int maxOutSize)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |