org.joda.beans.ser.bin
Class JodaBeanBinReader

java.lang.Object
  extended by org.joda.beans.ser.bin.JodaBeanBinReader

public class JodaBeanBinReader
extends Object

Provides the ability for a Joda-Bean to read from a binary format.

The binary format is defined by JodaBeanBinWriter.

This class contains mutable state and cannot be used from multiple threads. A new instance must be created for each message.


Constructor Summary
JodaBeanBinReader(JodaBeanSer settings)
          Creates an instance.
 
Method Summary
protected static boolean isArray(int typeByte)
           
protected static boolean isIntegral(int typeByte)
           
protected static boolean isMap(int typeByte)
           
protected static boolean isString(int typeByte)
           
 Bean read(byte[] input)
          Reads and parses to a bean.
<T> T
read(byte[] input, Class<T> rootType)
          Reads and parses to a bean.
 Bean read(InputStream input)
          Reads and parses to a bean.
<T> T
read(InputStream input, Class<T> rootType)
          Reads and parses to a bean.
protected static String toHex(int b)
          Converts a byte to a hex string for debugging.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JodaBeanBinReader

public JodaBeanBinReader(JodaBeanSer settings)
Creates an instance.

Parameters:
settings - the settings, not null
Method Detail

read

public Bean read(byte[] input)
Reads and parses to a bean.

Parameters:
input - the input bytes, not null
Returns:
the bean, not null

read

public <T> T read(byte[] input,
                  Class<T> rootType)
Reads and parses to a bean.

Type Parameters:
T - the root type
Parameters:
input - the input bytes, not null
rootType - the root type, not null
Returns:
the bean, not null

read

public Bean read(InputStream input)
Reads and parses to a bean.

Parameters:
input - the input reader, not null
Returns:
the bean, not null

read

public <T> T read(InputStream input,
                  Class<T> rootType)
Reads and parses to a bean.

Type Parameters:
T - the root type
Parameters:
input - the input stream, not null
rootType - the root type, not null
Returns:
the bean, not null

toHex

protected static String toHex(int b)
Converts a byte to a hex string for debugging.

Parameters:
b - the byte
Returns:
the two character hex equivalent, not null

isMap

protected static boolean isMap(int typeByte)
                        throws IOException
Throws:
IOException

isArray

protected static boolean isArray(int typeByte)
                          throws IOException
Throws:
IOException

isString

protected static boolean isString(int typeByte)
                           throws IOException
Throws:
IOException

isIntegral

protected static boolean isIntegral(int typeByte)
                             throws IOException
Throws:
IOException


Copyright © 2007–2015 Joda.org. All rights reserved.