FileDocCategorySizeDatePackage
TestcaseRecordInputStream.javaAPI DocApache Poi 3.0.11851Mon Jan 01 12:39:46 GMT 2007org.apache.poi.hssf.record

TestcaseRecordInputStream

public class TestcaseRecordInputStream extends RecordInputStream
A Record Input Stream derivative that makes access to byte arrays used in the test cases work a bit easier.

Creates the sream and moves to the first record.

author
Jason Height (jheight at apache.org)

Fields Summary
Constructors Summary
public TestcaseRecordInputStream(short sid, short length, byte[] data)

      super(new ByteArrayInputStream(mergeDataAndSid(sid, length, data)));
      nextRecord();
    
Methods Summary
public static byte[]mergeDataAndSid(short sid, short length, byte[] data)

      byte[] result = new byte[data.length + 4];
      LittleEndian.putShort(result, 0, sid);
      LittleEndian.putShort(result, 2, length);
      System.arraycopy(data, 0, result, 4, data.length);
      return result;