org.joda.beans.ser.bin
Class MsgPackVisualizer

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

public final class MsgPackVisualizer
extends Object

Allows MsgPack data to be visualized.


Constructor Summary
MsgPackVisualizer(byte[] bytes)
          Creates an instance.
MsgPackVisualizer(DataInputStream stream)
          Creates an instance.
MsgPackVisualizer(InputStream stream)
          Creates an instance.
 
Method Summary
protected  void handleArrayHeader(int size)
           
protected  void handleBinary(byte[] bytes)
           
protected  void handleBoolean(boolean bool)
           
protected  void handleDouble(double value)
           
protected  void handleExtension(int type, byte[] bytes)
           
protected  void handleFloat(float value)
           
protected  void handleInt(int value)
           
protected  void handleMapHeader(int size)
           
protected  void handleNil()
           
protected  void handleObjectStart()
           
protected  void handleSignedLong(long value)
           
protected  void handleString(String str)
           
protected  void handleUnknown(byte b)
           
protected  void handleUnsignedLong(long value)
           
protected static boolean isArray(int typeByte)
           
protected static boolean isIntegral(int typeByte)
           
protected static boolean isMap(int typeByte)
           
protected static boolean isString(int typeByte)
           
protected  void readAll()
          Reads all the data in the stream, closing the stream.
protected  void readArrayItem()
           
protected  void readMapKey()
           
protected  void readMapValue()
           
protected  void readObject(int unsigned)
           
static void skipObject(DataInputStream input)
          Skips over the next object in an input stream.
protected static String toHex(int b)
          Converts a byte to a hex string for debugging.
 void visualize()
          Visualizes the data in the stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MsgPackVisualizer

public MsgPackVisualizer(byte[] bytes)
Creates an instance.

Parameters:
bytes - the bytes to read, not null

MsgPackVisualizer

public MsgPackVisualizer(InputStream stream)
Creates an instance.

Parameters:
stream - the stream to read from, not null

MsgPackVisualizer

public MsgPackVisualizer(DataInputStream stream)
Creates an instance.

Parameters:
stream - the stream to read from, not null
Method Detail

visualize

public void visualize()
Visualizes the data in the stream.


readArrayItem

protected void readArrayItem()
                      throws IOException
Throws:
IOException

readMapKey

protected void readMapKey()
                   throws IOException
Throws:
IOException

readMapValue

protected void readMapValue()
                     throws IOException
Throws:
IOException

handleObjectStart

protected void handleObjectStart()

handleBoolean

protected void handleBoolean(boolean bool)

handleNil

protected void handleNil()

handleInt

protected void handleInt(int value)

handleUnsignedLong

protected void handleUnsignedLong(long value)

handleSignedLong

protected void handleSignedLong(long value)

handleFloat

protected void handleFloat(float value)

handleDouble

protected void handleDouble(double value)

handleUnknown

protected void handleUnknown(byte b)

handleString

protected void handleString(String str)

handleArrayHeader

protected void handleArrayHeader(int size)

handleMapHeader

protected void handleMapHeader(int size)

handleBinary

protected void handleBinary(byte[] bytes)

handleExtension

protected void handleExtension(int type,
                               byte[] bytes)
                        throws IOException
Throws:
IOException

readAll

protected void readAll()
Reads all the data in the stream, closing the stream.


readObject

protected void readObject(int unsigned)
                   throws IOException
Throws:
IOException

skipObject

public static void skipObject(DataInputStream input)
                       throws IOException
Skips over the next object in an input stream.

Parameters:
input - the input stream, not null
Throws:
IOException - if an error occurs

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–2014 Joda.org. All rights reserved.