org.norther.tammi.acorn.io
Class RecordReader

java.lang.Object
  extended by org.norther.tammi.acorn.io.RecordReader

public class RecordReader
extends Object

A buffered reader for reading records.

Version:
$Id: RecordReader.java,v 1.5 2009/09/28 15:08:49 cvsimp Exp $
Author:
Ilkka Priha

Constructor Summary
RecordReader()
          Constructs an empty record reader.
RecordReader(byte[] rec)
          Constructs a new record reader.
 
Method Summary
 DataInputStream getDataInputStream()
          Gets a data input stream.
 InputStream getInputStream()
          Gets an input stream.
 ObjectInputStream getObjectInputStream()
          Gets an object input stream.
 byte[] getRecord()
          Gets the record.
 Object readObject()
          Reads an object.
 String readUTF()
          Reads an UTF string.
 void setRecord(byte[] rec)
          Sets the record.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RecordReader

public RecordReader()
Constructs an empty record reader.


RecordReader

public RecordReader(byte[] rec)
Constructs a new record reader.

Parameters:
rec - the data record.
Method Detail

getRecord

public byte[] getRecord()
Gets the record.

Returns:
the data record.

setRecord

public void setRecord(byte[] rec)
Sets the record.

Parameters:
rec - the data record.

getInputStream

public InputStream getInputStream()
Gets an input stream.

Returns:
a record input stream.

getObjectInputStream

public ObjectInputStream getObjectInputStream()
                                       throws IOException
Gets an object input stream.

Returns:
an object input stream.
Throws:
IOException - on errors.

getDataInputStream

public DataInputStream getDataInputStream()
Gets a data input stream.

Returns:
an object input stream.

readObject

public Object readObject()
                  throws IOException,
                         OptionalDataException,
                         ClassNotFoundException
Reads an object.

Returns:
the object.
Throws:
IOException - on I/O errors.
OptionalDataException - for primitive data.
ClassNotFoundException - for missing classes.

readUTF

public String readUTF()
               throws IOException
Reads an UTF string.

Returns:
the string.
Throws:
IOException - on I/O errors.


Copyright © 2004 The Norther Organization. All rights reserved.