@Override public void close() throws IOException { flush(); writer.close(); writer = null; }
@Override public void flush() throws IOException { flushBuffer(); writer.flush(); }
public WriterOutputStream(final Writer pWriter, final String pCharset) { writer = pWriter; decoder = getDecoder(pCharset); }
@Override public final void write(byte[] pBytes) throws IOException { if (pBytes == null) { throw new NullPointerException("bytes == null"); } write(pBytes, 0, pBytes.length); }
OutputStream os = new WriterOutputStream(new PrintWriter(System.out), "UTF-8"); os.write(bytes); os.flush();
@Override public final void write(byte[] pBytes) throws IOException { if (pBytes == null) { throw new NullPointerException("bytes == null"); } write(pBytes, 0, pBytes.length); }
OutputStream os = new WriterOutputStream(new PrintWriter(System.out), "UTF-8"); os.write(bytes); os.flush();
@Override public final void write(byte[] pBytes, int pOffset, int pLength) throws IOException { flushBuffer(); decoder.decodeTo(writer, pBytes, pOffset, pLength); }
@Override public void close() throws IOException { flush(); mWriter.close(); mWriter = null; }
@Override public final void write(byte[] pBytes) throws IOException { if (pBytes == null) { throw new NullPointerException("bytes == null"); } write(pBytes, 0, pBytes.length); }
public WriterOutputStream(final Writer pWriter, final String pCharset) { writer = pWriter; decoder = getDecoder(pCharset); }
OutputStream os = new WriterOutputStream(new PrintWriter(System.out), "UTF-8"); os.write(bytes); os.flush();
@Override public void flush() throws IOException { flushBuffer(); mWriter.flush(); }
@Override public void close() throws IOException { flush(); writer.close(); writer = null; }
public WriterOutputStream(final Writer pWriter, final String pCharset) { mWriter = pWriter; mDecoder = getDecoder(pCharset); }
@Override public void flush() throws IOException { flushBuffer(); writer.flush(); }
@Override public final void write(byte[] pBytes, int pOffset, int pLength) throws IOException { flushBuffer(); decoder.decodeTo(writer, pBytes, pOffset, pLength); }
@Override public final void write(byte[] pBytes, int pOffset, int pLength) throws IOException { flushBuffer(); mDecoder.decodeTo(mWriter, pBytes, pOffset, pLength); }