List of usage examples for org.apache.commons.io ByteOrderMark getBytes
public byte[] getBytes()
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)); }