Example usage for org.apache.wicket.util.io IOUtils write

List of usage examples for org.apache.wicket.util.io IOUtils write

Introduction

In this page you can find the example usage for org.apache.wicket.util.io IOUtils write.

Prototype

public static void write(final StringBuilder data, final OutputStream output) throws IOException 

Source Link

Document

Writes chars from a AppendingStringBuffer to bytes on an OutputStream using the default character encoding of the platform.

Usage

From source file:com.googlecode.refit.web.EditPage.java

License:Open Source License

private void saveText(String editedText) {
    try {/*  w w w .ja va2  s .c  o m*/
        PrintWriter pw = new PrintWriter(inputFileName, "UTF-8");
        IOUtils.write(editedText, pw);
        pw.close();
    } catch (IOException exc) {
        throw new RuntimeException(exc);
    }
}

From source file:org.apache.jetspeed.security.mfa.TestCaptchaImageResource.java

License:Apache License

public void testCaptchaImageData() throws Exception {
    CaptchaImageResource cir = new CaptchaImageResource(captchaConfig);
    cir.setBackgroundImage(background);/*from  w ww .j av  a2 s .c o  m*/
    cir.init();

    OutputStream output = null;

    try {
        output = new FileOutputStream(tempCaptchaFile);
        IOUtils.write(cir.getImageBytes(), output);
    } finally {
        IOUtils.closeQuietly(output);
    }

    assertTrue(tempCaptchaFile.length() > 0);
}