dk.vajhoej.record
Class StructReader

java.lang.Object
  extended by dk.vajhoej.record.StructReader

public class StructReader
extends java.lang.Object

Class StructReader reads a Java object from a byte array containing a native struct.


Constructor Summary
StructReader(byte[] ba)
          Create instance of StructReader.
 
Method Summary
 boolean more()
          More records available.
<T> T
read(java.lang.Class<T> t)
          Read.
<T> T
read(java.lang.Class<T> t, InfoProvider lenpvd)
          Read.
<T> T
read(java.lang.Class<T> t, LengthProvider lenpvd)
          Read.
<T> T
read(java.lang.Class<T> t, LengthProvider2 lenpvd)
          Read.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StructReader

public StructReader(byte[] ba)
Create instance of StructReader.

Parameters:
ba - byte array to read from
Method Detail

read

public <T> T read(java.lang.Class<T> t)
       throws RecordException
Read.

Parameters:
t - class of what to read
Returns:
object read
Throws:
RecordException - if impossible to convert between types in class and struct

read

public <T> T read(java.lang.Class<T> t,
                  LengthProvider lenpvd)
       throws RecordException
Read.

Parameters:
t - class of what to read
lenpvd - supplies length for fields where it is not given (null indicates that it is to be ignored)
Returns:
object read
Throws:
RecordException - if impossible to convert between types in class and struct

read

public <T> T read(java.lang.Class<T> t,
                  LengthProvider2 lenpvd)
       throws RecordException
Read.

Parameters:
t - class of what to read
lenpvd - supplies length for fields where it is not given (null indicates that it is to be ignored)
Returns:
object read
Throws:
RecordException - if impossible to convert between types in class and struct

read

public <T> T read(java.lang.Class<T> t,
                  InfoProvider lenpvd)
       throws RecordException
Read.

Parameters:
t - class of what to read
lenpvd - supplies various length'es where they are not given (null indicates that it is to be ignored)
Returns:
object read
Throws:
RecordException - if impossible to convert between types in class and struct

more

public boolean more()
More records available.

Returns:
true=more, false=no more