Example usage for org.apache.poi.hssf.record DConRefRecord serialize

List of usage examples for org.apache.poi.hssf.record DConRefRecord serialize

Introduction

In this page you can find the example usage for org.apache.poi.hssf.record DConRefRecord serialize.

Prototype

@Override
    protected void serialize(LittleEndianOutput 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);
    o.flush();//ww w .  j  a  v a2 s .c  o m
    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  v  a 2  s . co m*/
 * @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());

}