/** * Saves the text in this editor to the specified location. * * @param loc The location to save to. * @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(); } }
String oldEncoding = getEncoding(); UnicodeReader ur = new UnicodeReader(loc.getInputStream(), oldEncoding); String encoding = ur.getEncoding();
@Test public void testGetSetEncoding() { TextEditorPane textArea = new TextEditorPane(); Assert.assertFalse(textArea.isDirty()); textArea.setEncoding("UTF-16"); Assert.assertEquals("UTF-16", textArea.getEncoding()); Assert.assertTrue(textArea.isDirty()); textArea.setDirty(false); textArea.setEncoding("UTF-8"); Assert.assertEquals("UTF-8", textArea.getEncoding()); Assert.assertTrue(textArea.isDirty()); }
/** * Saves the text in this editor to the specified location. * * @param loc The location to save to. * @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(); } }
/** * Saves the text in this editor to the specified location. * * @param loc The location to save to. * @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(); } }
/** * Saves the text in this editor to the specified location. * * @param loc The location to save to. * @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(); } }
String oldEncoding = getEncoding(); UnicodeReader ur = new UnicodeReader(loc.getInputStream(), oldEncoding); String encoding = ur.getEncoding();
String oldEncoding = getEncoding(); UnicodeReader ur = new UnicodeReader(loc.getInputStream(), oldEncoding); String encoding = ur.getEncoding();
String oldEncoding = getEncoding(); UnicodeReader ur = new UnicodeReader(loc.getInputStream(), oldEncoding); String encoding = ur.getEncoding();