csheets.io
Class CLSCodec

java.lang.Object
  extended by csheets.io.CLSCodec
All Implemented Interfaces:
Codec

public class CLSCodec
extends Object
implements Codec

A codec for the native CleanSheets format that uses Java Serialization.

Author:
Einar Pehrson

Constructor Summary
CLSCodec()
          Creates a new CleanSheets codec.
 
Method Summary
 Workbook read(InputStream stream)
          Reads a workbook from the given input stream.
 void write(Workbook workbook, OutputStream stream)
          Writes a workbook to the given output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CLSCodec

public CLSCodec()
Creates a new CleanSheets codec.

Method Detail

read

public Workbook read(InputStream stream)
              throws IOException,
                     ClassNotFoundException
Description copied from interface: Codec
Reads a workbook from the given input stream.

Specified by:
read in interface Codec
Parameters:
stream - the input stream from which the workbook should be read
Throws:
IOException - if the workbook could not be read correctly
ClassNotFoundException - If the class of a serialized object could not be found

write

public void write(Workbook workbook,
                  OutputStream stream)
           throws IOException
Description copied from interface: Codec
Writes a workbook to the given output stream.

Specified by:
write in interface Codec
stream - the output stream to which the workbook should be written
Throws:
IOException - if the workbook could not be written correctly