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

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

Introduction

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

Prototype

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

Source Link

Document

Takes a unicode (java) string, and returns it as 8 bit data (in ISO-8859-1 codepage).

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)/* ww  w  . j  av a 2s .c om*/
        StringUtil.putUnicodeLE(s, result, dest.length);
    else
        StringUtil.putCompressedUnicode(s, result, dest.length);

    return result;
}