Example usage for org.apache.poi.util StringUtil putUnicodeLE

List of usage examples for org.apache.poi.util StringUtil putUnicodeLE

Introduction

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

Prototype

public static void putUnicodeLE(String input, byte[] output, int offset) 

Source Link

Document

Takes a unicode string, and returns it as little endian (most important byte last) bytes in the supplied byte array.

Usage

From source file:org.ddt.ByteArrayUtils.java

License:Apache License

public static byte[] addString(byte[] dest, String s, boolean unicode) {
    int stringLength = unicode ? 2 * s.length() : s.length();

    byte[] result = Arrays.copyOf(dest, dest.length + stringLength);
    if (unicode)//from w  w w  . j  a  v a 2 s.c o m
        StringUtil.putUnicodeLE(s, result, dest.length);
    else
        StringUtil.putCompressedUnicode(s, result, dest.length);

    return result;
}