| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectorg.xsocket.DataConverter
public final class DataConverter
a data converter utilities class
| Constructor Summary | |
|---|---|
| DataConverter() | |
| Method Summary | |
|---|---|
| static ByteBuffer | toByteBuffer(byte b)converts a single byte to a byte buffer | 
| static ByteBuffer | toByteBuffer(byte[] bytes)converts a byte array to a byte buffer | 
| static ByteBuffer | toByteBuffer(byte[] bytes,
             int offset,
             int length)converts a byte array to a byte buffer | 
| static ByteBuffer | toByteBuffer(ByteBuffer[] buffers)merges a ByteBuffer array into a (direct) ByteBuffer | 
| static ByteBuffer | toByteBuffer(double d)converts a double to a byte buffer | 
| static ByteBuffer | toByteBuffer(int i)converts a integer to a byte buffer | 
| static ByteBuffer | toByteBuffer(long l)converts a long to a byte buffer | 
| static ByteBuffer | toByteBuffer(short s)converts a short to a byte buffer | 
| static ByteBuffer | toByteBuffer(String s,
             String encoding)converts the given String into a ByteBuffer | 
| static ByteBuffer[] | toByteBuffers(ByteBuffer[] srcs,
              int offset,
              int length)copies a array of ByteBuffer based on offset length to a byte buffer array | 
| static byte[] | toBytes(ByteBuffer buffer)converts a ByteBuffer into a byte array | 
| static byte[] | toBytes(ByteBuffer[] buffers)converts a ByteBuffer array to a byte array | 
| static byte[] | toBytes(List<ByteBuffer> buffers)converts a list of ByteBuffer to a byte array | 
| static Date | toDate(String rfc822DateString)converts a RFC822 date string into a date object | 
| static String | toFormatedBytesSize(long bytes)converts the given byte size in a textual representation | 
| static String | toFormatedDate(long time)converts the given time in a textual representation | 
| static String | toFormatedDuration(long duration)converts the given duration in a textual representation | 
| static String | toFormatedRFC822Date(long time)converts the given time in a RFC822 conform date representation | 
| static String | toHexString(byte[] buffers,
            int maxOutSize)print the byte array as a hex string | 
| static String | toHexString(ByteBuffer buffer)converts the given ByteBuffer into a hex string | 
| static String | toHexString(ByteBuffer[] buffers,
            int maxOutSize)print the byte buffer as a hex string | 
| static String | toHexString(List<ByteBuffer> buffers,
            int maxOutSize)print the byte buffer as a hex string | 
| static String | toString(ByteBuffer buffer)converts the given ByteBuffer into String by using UTF-8 encoding | 
| static String | toString(ByteBuffer[] buffer)converts the given ByteBuffer array into String by using UTF-8 encoding | 
| static String | toString(ByteBuffer[] buffers,
         String encoding)converts the given array of ByteBuffers into String | 
| static String | toString(ByteBuffer[] buffers,
         String encoding,
         int maxOutSize)print the bytebuffer as limited string | 
| static String | toString(ByteBuffer buffer,
         String encoding)converts the given ByteBuffer into String repesentation | 
| static String | toString(List<ByteBuffer> buffers)converts the given list of ByteBuffers into a String by using UTF-8 encoding | 
| static String | toString(List<ByteBuffer> buffers,
         String encoding)converts the given list of ByteBuffers into a String | 
| static String | toString(StackTraceElement[] elements)converts a stack into a String | 
| static String | toString(Throwable t) | 
| static String | toTextAndHexString(ByteBuffer[] buffers,
                   String encoding,
                   int maxOutSize) | 
| static String | toTextOrHexString(ByteBuffer[] buffers,
                  String encoding,
                  int maxOutSize)convert the ByteBuffer array into a hex or text string (deping on content) | 
| static String | toTextOrHexString(ByteBuffer buffer,
                  String encoding,
                  int maxOutSize)convert the ByteBuffer into a hex or text string (deping on content) | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public DataConverter()
| Method Detail | 
|---|
public static String toFormatedBytesSize(long bytes)
bytes - the bytes to convert
public static String toFormatedDate(long time)
time - the time to convert
public static String toFormatedRFC822Date(long time)
time - the time to convert
public static Date toDate(String rfc822DateString)
rfc822DateString - the rfc822 string
public static String toFormatedDuration(long duration)
duration - the duration to convert
public static ByteBuffer toByteBuffer(String s,
                                      String encoding)
s - the String to convertencoding - the encoding to use
public static String toString(StackTraceElement[] elements)
elements - the stack trace elements
public static String toString(ByteBuffer buffer)
                       throws UnsupportedEncodingException
buffer - the ByteBuffer to convert
UnsupportedEncodingException
public static String toString(ByteBuffer[] buffer)
                       throws UnsupportedEncodingException
buffer - the ByteBuffer arrayto convert
UnsupportedEncodingException
public static String toString(ByteBuffer buffer,
                              String encoding)
                       throws UnsupportedEncodingException
buffer - the ByteBuffer to convertencoding - the encoding to use
UnsupportedEncodingExceptionpublic static String toHexString(ByteBuffer buffer)
buffer - the ByteBuffer to convert
public static String toString(List<ByteBuffer> buffers)
                       throws UnsupportedEncodingException
buffers - the list of ByteBuffer to convert
UnsupportedEncodingException
public static String toString(List<ByteBuffer> buffers,
                              String encoding)
                       throws UnsupportedEncodingException
buffers - the list of ByteBuffer to convertencoding - the encoding to use
UnsupportedEncodingException
public static String toString(ByteBuffer[] buffers,
                              String encoding)
                       throws UnsupportedEncodingException
buffers - the array of ByteBuffer to convertencoding - the encoding to use
UnsupportedEncodingException
public static String toString(ByteBuffer[] buffers,
                              String encoding,
                              int maxOutSize)
                       throws UnsupportedEncodingException
buffers - the buffers to printencoding - the encoding to usemaxOutSize - the max size to print
UnsupportedEncodingExceptionpublic static ByteBuffer toByteBuffer(ByteBuffer[] buffers)
buffers - the ByteBuffer array to merge
public static ByteBuffer toByteBuffer(byte b)
b - the byte
public static ByteBuffer toByteBuffer(byte[] bytes)
bytes - the byte array
public static ByteBuffer toByteBuffer(byte[] bytes,
                                      int offset,
                                      int length)
bytes - the bytesoffset - the offsetlength - the length
public static ByteBuffer toByteBuffer(double d)
d - the double
public static ByteBuffer toByteBuffer(long l)
l - the long
public static ByteBuffer toByteBuffer(short s)
s - the short
public static ByteBuffer toByteBuffer(int i)
i - the int
public static ByteBuffer[] toByteBuffers(ByteBuffer[] srcs,
                                         int offset,
                                         int length)
srcs - the buffersoffset - the offsetlength - the length
public static byte[] toBytes(List<ByteBuffer> buffers)
buffers - the ByteBuffer list to convert
public static byte[] toBytes(ByteBuffer[] buffers)
buffers - the ByteBuffer array to convert
public static byte[] toBytes(ByteBuffer buffer)
buffer - the ByteBuffer to convert
public static String toHexString(byte[] buffers,
                                 int maxOutSize)
buffers - the buffers to printmaxOutSize - the max size to print
public static String toHexString(List<ByteBuffer> buffers,
                                 int maxOutSize)
buffers - the buffers to printmaxOutSize - the max size to print
public static String toHexString(ByteBuffer[] buffers,
                                 int maxOutSize)
buffers - the buffers to printmaxOutSize - the max size to print
public static String toTextOrHexString(ByteBuffer buffer,
                                       String encoding,
                                       int maxOutSize)
buffer - the buffers to printmaxOutSize - the max size to printencoding - the encoding to use
public static String toTextOrHexString(ByteBuffer[] buffers,
                                       String encoding,
                                       int maxOutSize)
buffers - the buffers to printmaxOutSize - the max size to printencoding - the encoding to use
public static String toTextAndHexString(ByteBuffer[] buffers,
                                        String encoding,
                                        int maxOutSize)
public static String toString(Throwable t)
| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||