import java.io.*; public class BufferedOutputStreamDemo { public static void main(String[] args) { try(FileInputStream fis = new FileInputStream("BufferedInputStreamDemo.java"); BufferedInputStream bis = new BufferedInputStream(fis); FileOutputStream fos = new FileOutputStream("target.txt"); BufferedOutputStream bos = new BufferedOutputStream(fos); ) { int c; while((c=bis.read()) != -1) { bos.write((char)c); } } catch(IOException ie) { ie.printStackTrace();} } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter