public class Util2
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
Util2.ObjectHandler<T>
Interface for processing objects read.
|
static interface |
Util2.Transformer<T1,T2>
Interface for converting objects read.
|
| Constructor and Description |
|---|
Util2() |
| Modifier and Type | Method and Description |
|---|---|
static <T1,T2> byte[] |
copyAll(java.lang.Class<T1> t1,
byte[] b,
java.lang.Class<T2> t2,
Util2.Transformer<T1,T2> cvt,
LengthProvider2 lenpvd)
Convert array of struct in bytes into array of struct in bytes.
|
static <T1,T2> void |
copyAll(java.lang.Class<T1> t1,
java.io.InputStream is,
java.lang.Class<T2> t2,
java.io.OutputStream os,
Util2.Transformer<T1,T2> cvt,
LengthProvider2 lenpvd)
Convert array of struct in stream into array of struct in stream.
|
static <T> java.util.List<T> |
readAll(java.lang.Class<T> t,
byte[] b,
LengthProvider2 lenpvd)
Read array of struct in byte array into list of objects.
|
static <T> void |
readAll(java.lang.Class<T> t,
java.io.InputStream is,
java.util.List<T> lst,
LengthProvider2 lenpvd)
Read array of struct in stream into list of objects.
|
static <T> void |
readAll(java.lang.Class<T> t,
java.io.InputStream is,
Util2.ObjectHandler<T> oh,
LengthProvider2 lenpvd)
Read array of struct in stream and processes them by handler.
|
static <T> byte[] |
writeAll(java.lang.Class<T> t,
java.util.List<T> lst,
LengthProvider2 lenpvd)
Write list of objects into array of struct in byte array.
|
static <T> void |
writeAll(java.lang.Class<T> t,
java.util.List<T> lst,
java.io.OutputStream os,
LengthProvider2 lenpvd)
Write list of objects into array of struct in stream.
|
public static <T> java.util.List<T> readAll(java.lang.Class<T> t,
byte[] b,
LengthProvider2 lenpvd)
throws RecordException
T - struct typet - typeb - byte arraylenpvd - length providerRecordException - if problem with record definitionpublic static <T> byte[] writeAll(java.lang.Class<T> t,
java.util.List<T> lst,
LengthProvider2 lenpvd)
throws RecordException
T - struct typet - typelst - list of objectslenpvd - length providerRecordException - if problem with record definitionpublic static <T> void readAll(java.lang.Class<T> t,
java.io.InputStream is,
java.util.List<T> lst,
LengthProvider2 lenpvd)
throws RecordException,
java.io.IOException
T - struct typet - typeis - streamlst - list of objectslenpvd - length providerRecordException - if problem with record definitionjava.io.IOException - if problem with streampublic static <T> void writeAll(java.lang.Class<T> t,
java.util.List<T> lst,
java.io.OutputStream os,
LengthProvider2 lenpvd)
throws RecordException,
java.io.IOException
T - struct typet - typelst - list of objectsos - streamlenpvd - length providerRecordException - if problem with record definitionjava.io.IOException - if problem with streampublic static <T> void readAll(java.lang.Class<T> t,
java.io.InputStream is,
Util2.ObjectHandler<T> oh,
LengthProvider2 lenpvd)
throws RecordException,
java.io.IOException
T - struct typet - typeis - streamoh - handler of objectslenpvd - length providerRecordException - if problem with record definitionjava.io.IOException - if problem with streampublic static <T1,T2> byte[] copyAll(java.lang.Class<T1> t1,
byte[] b,
java.lang.Class<T2> t2,
Util2.Transformer<T1,T2> cvt,
LengthProvider2 lenpvd)
throws RecordException
T1 - input struct typeT2 - output struct typet1 - from typeb - from byte arrayt2 - to typecvt - transformer classlenpvd - length providerRecordException - if problem with record definitionspublic static <T1,T2> void copyAll(java.lang.Class<T1> t1,
java.io.InputStream is,
java.lang.Class<T2> t2,
java.io.OutputStream os,
Util2.Transformer<T1,T2> cvt,
LengthProvider2 lenpvd)
throws RecordException,
java.io.IOException
T1 - input struct typeT2 - output struct typet1 - from typeis - from streamt2 - to typeos - to streamcvt - transformer classlenpvd - length providerRecordException - if problem with record definitionsjava.io.IOException - if problem with streams