Examples of UnicodeWriter


Examples of org.apache.metamodel.util.UnicodeWriter

public class UnicodeWriterTest {

    @Test
    public void test() throws IOException {
        File file = new File("target/unicodeWriterTest.txt");
        Writer writer = new UnicodeWriter(file, "UTF-8");
        writer.write("Hello");
        writer.close();

        FileInputStream is = new FileInputStream(file);
        byte[] bytes = new byte[100];
        assertEquals(8, is.read(bytes));
View Full Code Here

Examples of org.fife.io.UnicodeWriter

   * @throws IOException If an IO error occurs.
   */
  private void saveImpl(FileLocation loc) throws IOException {
    OutputStream out = loc.getOutputStream();
    PrintWriter w = new PrintWriter(
      new BufferedWriter(new UnicodeWriter(out, getEncoding())));
    try {
      write(w);
    } finally {
      w.close();
    }
View Full Code Here

Examples of org.fife.io.UnicodeWriter

   * @throws IOException If an IO error occurs.
   */
  private void saveImpl(FileLocation loc) throws IOException {
    OutputStream out = loc.getOutputStream();
    BufferedWriter w = new BufferedWriter(
        new UnicodeWriter(out, getEncoding()));
    try {
      write(w);
    } finally {
      w.close();
    }
View Full Code Here

Examples of org.fife.io.UnicodeWriter

      DOMSource source = new DOMSource(doc);
      // Use a writer instead of OutputStream to allow pretty printing.
      // See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6337981
      StreamResult result = new StreamResult(new PrintWriter(
          new UnicodeWriter(bout, "UTF-8")));
      TransformerFactory transFac = TransformerFactory.newInstance();
      Transformer transformer = transFac.newTransformer();
      transformer.setOutputProperty(OutputKeys.INDENT, "yes");
      transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
      transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
View Full Code Here

Examples of org.fife.io.UnicodeWriter

      DOMSource source = new DOMSource(doc);
      // Use a writer instead of OutputStream to allow pretty printing.
      // See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6337981
      StreamResult result = new StreamResult(new PrintWriter(
          new UnicodeWriter(bout, "UTF-8")));
      TransformerFactory transFac = TransformerFactory.newInstance();
      Transformer transformer = transFac.newTransformer();
      transformer.setOutputProperty(OutputKeys.INDENT, "yes");
      transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
      transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
View Full Code Here

Examples of org.fife.io.UnicodeWriter

   * @throws IOException If an IO error occurs.
   */
  private void saveImpl(FileLocation loc) throws IOException {
    OutputStream out = loc.getOutputStream();
    BufferedWriter w = new BufferedWriter(
        new UnicodeWriter(out, getEncoding()));
    try {
      write(w);
    } finally {
      w.close();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.