Example usage for org.apache.poi.util LittleEndian putShort

List of usage examples for org.apache.poi.util LittleEndian putShort

Introduction

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

Prototype

public static void putShort(byte[] data, int offset, short value) 

Source Link

Document

put a short value into a byte array

Usage

From source file:org.ddt.ByteArrayUtils.java

License:Apache License

public static byte[] addShort(byte[] dest, short s) {
    byte[] result = Arrays.copyOf(dest, dest.length + 2);
    LittleEndian.putShort(result, dest.length, s);
    return result;
}

From source file:org.textmining.extraction.word.model.PieceDescriptor.java

License:Open Source License

protected byte[] toByteArray() {
    // set up the fc
    int tempFc = fc;
    if (!unicode) {
        tempFc *= 2;// w  w  w .ja v a  2s.  c om
        tempFc |= (0x40000000);
    }

    int offset = 0;
    byte[] buf = new byte[8];
    LittleEndian.putShort(buf, offset, descriptor);
    offset += LittleEndian.SHORT_SIZE;
    LittleEndian.putInt(buf, offset, tempFc);
    offset += LittleEndian.INT_SIZE;
    LittleEndian.putShort(buf, offset, prm);

    return buf;

}