Example usage for org.apache.poi.util LittleEndianOutputStream LittleEndianOutputStream

List of usage examples for org.apache.poi.util LittleEndianOutputStream LittleEndianOutputStream

Introduction

In this page you can find the example usage for org.apache.poi.util LittleEndianOutputStream LittleEndianOutputStream.

Prototype

public LittleEndianOutputStream(OutputStream out) 

Source Link

Usage

From source file:org.ddt.listener.records.DConRefRecordTest.java

License:Apache License

private void testReadWrite(byte[] data, String message) throws IOException {
    RecordInputStream is = TestcaseRecordInputStream.create(81, data);
    DConRefRecord d = new DConRefRecord(is);
    ByteArrayOutputStream bos = new ByteArrayOutputStream(data.length);
    LittleEndianOutputStream o = new LittleEndianOutputStream(bos);
    d.serialize(o);/*  ww w .  ja  va  2 s .  co m*/
    o.flush();
    assertArrayEquals(message, data, bos.toByteArray());
}

From source file:org.ddt.listener.records.DConRefRecordTest.java

License:Apache License

/**
 * test read-constructor-then-serialize for a single-byte self-reference style string
 * <p/>/*from w  w w  .j  a  va  2  s.  c om*/
 * @throws IOException
 */
@Test
public void testReadWriteSBSelfRef() throws IOException {
    RecordInputStream is = TestcaseRecordInputStream.create(81, data3);
    DConRefRecord d = new DConRefRecord(is);
    ByteArrayOutputStream bos = new ByteArrayOutputStream(data3.length);
    LittleEndianOutputStream o = new LittleEndianOutputStream(bos);
    d.serialize(o);
    o.flush();
    assertArrayEquals("read-write single byte self reference", data3, bos.toByteArray());

}