TestcaseRecordInputStreampublic 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. |
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;
|
|