org.millscript.office.excel
Class BIFFRecordInputStream

java.lang.Object
  extended by org.millscript.office.excel.BIFFRecordInputStream

public class BIFFRecordInputStream
extends java.lang.Object

This class extends a filter input stream with the methods required to decode BIFF records.


Constructor Summary
BIFFRecordInputStream(byte[] b)
          Constructs a new BIFF record input stream to read records from the specified byte array.
BIFFRecordInputStream(java.io.InputStream is)
          Constructs a new BIFF record input stream to read records from the specified input stream.
 
Method Summary
 boolean hasMoreBytes()
           
 int read()
           
 int read2ByteInt()
          Reads 2 bytes from the stream as a 16 bit little endian positive integer.
 byte[] readBytes(int len)
          Reads the requeste number of bytes from the stream and returns them as a byte array.
 byte[] readRecordData()
          Returns the next records data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BIFFRecordInputStream

public BIFFRecordInputStream(byte[] b)
Constructs a new BIFF record input stream to read records from the specified byte array.

Parameters:
b - the byte array to decode

BIFFRecordInputStream

public BIFFRecordInputStream(java.io.InputStream is)
Constructs a new BIFF record input stream to read records from the specified input stream.

Parameters:
is - the InputStream to fetch byte data from
Method Detail

hasMoreBytes

public boolean hasMoreBytes()

read

public int read()
         throws java.io.IOException
Throws:
java.io.IOException

read2ByteInt

public int read2ByteInt()
Reads 2 bytes from the stream as a 16 bit little endian positive integer.

Returns:
an int for the two bytes read from the stream
Throws:
java.io.IOException - if there is a problem reading from the stream

readBytes

public byte[] readBytes(int len)
Reads the requeste number of bytes from the stream and returns them as a byte array.

Parameters:
len - the number of bytes to read from the stream
Returns:
a byte array holding the bytes read
Throws:
java.io.IOException - if there is a problem reading from the stream

readRecordData

public byte[] readRecordData()
Returns the next records data. This is equivalent to a call to read2ByteInt() to determine the record data length then calling readBytes(int) to read the data.

Returns:
a byte array with the next records data.
Throws:
java.io.IOException - if there is a problem reading from the stream


Copyright © 2006-2007 Open World Ltd. All Rights Reserved.