org.jtoolkit.essence.app.pojo
Class DatableUtils

java.lang.Object
  extended by org.jtoolkit.essence.app.pojo.DatableUtils

public class DatableUtils
extends java.lang.Object

Author:
Peter Lawrey

Field Summary
static java.lang.Class[] BASE_CLASSES
           
static java.lang.Object[] OBJECT_DICT
           
 
Method Summary
static void close(java.io.Closeable closeable)
           
static java.lang.Object[] fromBytes(byte[] bytes, int min, int max)
          Convert byte[] to a number of Object.
static void prune(java.io.DataOutput out)
           
static long readBER(java.io.DataInput in)
           
static java.lang.Object readObject(java.io.DataInput in)
           
static java.lang.Object[] readObjects(java.io.DataInput in, int min, int max)
          Read a number of objects from in.
static
<T> void
registerBuilder(java.lang.Class<T> clazz, Mapping<java.io.DataInput,T> builder)
           
static byte[] toBytes(java.lang.Object... object)
          Convert a number of object (collectively) to a byte[].
static void writeBER(java.io.DataOutput out, long v)
           
static void writeObject(java.io.DataOutput out, java.lang.Object datable)
           
static void writeObjects(java.io.DataOutput out, java.lang.Object... datables)
          Write a number of objects to the output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BASE_CLASSES

public static final java.lang.Class[] BASE_CLASSES

OBJECT_DICT

public static final java.lang.Object[] OBJECT_DICT
Method Detail

close

public static void close(java.io.Closeable closeable)

fromBytes

public static java.lang.Object[] fromBytes(byte[] bytes,
                                           int min,
                                           int max)
                                    throws java.io.IOException
Convert byte[] to a number of Object. Limits on the number of expected objects can be given.

Throws:
java.io.IOException

prune

public static void prune(java.io.DataOutput out)

readBER

public static long readBER(java.io.DataInput in)
                    throws java.io.IOException
Throws:
java.io.IOException

readObjects

@NotNull
public static java.lang.Object[] readObjects(@NotNull
                                                     java.io.DataInput in,
                                                     int min,
                                                     int max)
                                      throws java.io.IOException
Read a number of objects from in. Limits on the number of expected objects can be given. min and max can be 0 and Integer.MAX_INT respectly.

Throws:
java.io.IOException

readObject

public static java.lang.Object readObject(java.io.DataInput in)
                                   throws java.io.IOException
Throws:
java.io.IOException

registerBuilder

public static <T> void registerBuilder(java.lang.Class<T> clazz,
                                       Mapping<java.io.DataInput,T> builder)

toBytes

@NotNull
public static byte[] toBytes(java.lang.Object... object)
                      throws java.io.IOException
Convert a number of object (collectively) to a byte[]. Can be decoded with fromBytes()

Throws:
java.io.IOException

writeBER

public static void writeBER(java.io.DataOutput out,
                            long v)
                     throws java.io.IOException
Throws:
java.io.IOException

writeObjects

public static void writeObjects(@NotNull
                                java.io.DataOutput out,
                                java.lang.Object... datables)
                         throws java.io.IOException
Write a number of objects to the output stream.

Throws:
java.io.IOException

writeObject

public static void writeObject(java.io.DataOutput out,
                               java.lang.Object datable)
                        throws java.io.IOException
Throws:
java.io.IOException


Copyright © Peter Lawrey. All Rights Reserved.