Example usage for org.apache.commons.io.output WriterOutputStream write

List of usage examples for org.apache.commons.io.output WriterOutputStream write

Introduction

In this page you can find the example usage for org.apache.commons.io.output WriterOutputStream write.

Prototype

@Override
public void write(int b) throws IOException 

Source Link

Document

Write a single byte to the stream.

Usage

From source file:ee.ria.xroad.common.util.PasswordStore.java

private static char[] byteToChar(byte[] bytes) throws IOException {
    if (bytes == null) {
        return null;
    }/*from  w  w w  .j a v  a2 s . co m*/

    CharArrayWriter writer = new CharArrayWriter(bytes.length);
    WriterOutputStream os = new WriterOutputStream(writer, UTF_8);
    os.write(bytes);
    os.close();

    return writer.toCharArray();
}