com.hdcookbook.grin.io.binary
Class GrinBinaryReader

java.lang.Object
  extended by com.hdcookbook.grin.io.binary.GrinBinaryReader

public class GrinBinaryReader
extends java.lang.Object

The main class to read in a Show object from a binary file format.


Constructor Summary
GrinBinaryReader(java.io.InputStream stream)
          Constructs a GrinBinaryReader instance.
GrinBinaryReader(java.io.InputStream stream, java.lang.ClassLoader loader)
          Constructs a GrinBinaryReader instance.
 
Method Summary
 void readShow(Show show)
          Reconstructs the Show object passed in as argument.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GrinBinaryReader

public GrinBinaryReader(java.io.InputStream stream)
Constructs a GrinBinaryReader instance.

Parameters:
stream - An InputStream to the grin binary format data. It is recommended to be an instance of BufferedInputStream for a performance improvement.

GrinBinaryReader

public GrinBinaryReader(java.io.InputStream stream,
                        java.lang.ClassLoader loader)
Constructs a GrinBinaryReader instance.

Parameters:
stream - An InputStream to the grin binary format data. It is recommended to be an instance of BufferedInputStream for a performance improvement.
loader - An ClassLoader to use for finding needed classes to construct the Show object. Extensions and Command subclasses will be searched using this classloader, if given.
Method Detail

readShow

public void readShow(Show show)
              throws java.io.IOException
Reconstructs the Show object passed in as argument.

Parameters:
show - An empty Show object to reconstruct.
Throws:
java.io.IOException - if binary data parsing fails.