Here you can find the source of toBuffered(OutputStream stream)
public static BufferedWriter toBuffered(OutputStream stream)
//package com.java2s; //License from project: Open Source License import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.ByteArrayInputStream; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.Reader; import java.io.Writer; public class Main { public static BufferedWriter toBuffered(OutputStream stream) { return toBuffered(toWriter(stream)); }/*from w w w .j a va 2 s .c o m*/ public static BufferedWriter toBuffered(Writer writer) { return new BufferedWriter(writer); } public static BufferedReader toBuffered(InputStream stream) { return toBuffered(toReader(stream)); } public static BufferedReader toBuffered(Reader reader) { return new BufferedReader(reader); } public static Writer toWriter(OutputStream stream) { return new OutputStreamWriter(stream); } public static Reader toReader(InputStream stream) { return new InputStreamReader(stream); } public static Reader toReader(byte[] buf, int off, int len) { return toReader(new ByteArrayInputStream(buf, off, len)); } }