Example usage for org.apache.commons.io ByteOrderMark getBytes

List of usage examples for org.apache.commons.io ByteOrderMark getBytes

Introduction

In this page you can find the example usage for org.apache.commons.io ByteOrderMark getBytes.

Prototype

public byte[] getBytes() 

Source Link

Document

Return a copy of the BOM's bytes.

Usage

From source file:org.omegat.util.TMXReaderTest.java

void testXml(File xml, ByteOrderMark bom, String text, String charset) throws Exception {
    FileOutputStream out = new FileOutputStream(xml);
    try {/*w  ww . j  av a2  s  .c om*/
        if (bom != null) {
            out.write(bom.getBytes());
        }
        out.write(text.getBytes(charset));
    } finally {
        IOUtils.closeQuietly(out);
    }
    assertEquals(charset, TMXReader2.detectCharset(xml));
}