1 26 27 package net.sourceforge.groboutils.util.io.v1; 28 29 30 import java.io.File ; 31 import java.io.Writer ; 32 import java.io.OutputStream ; 33 import java.io.IOException ; 34 35 36 43 public class WriterOutputStream extends OutputStream 44 { 45 private Writer w; 46 public WriterOutputStream( Writer w ) 47 { 48 this.w = w; 49 } 50 public void write( int b ) 51 throws IOException 52 { 53 this.w.write( b ); 54 } 55 public void write( byte b[], int off, int len ) 56 throws IOException 57 { 58 this.w.write( new String ( b, off, len ) ); 59 } 60 public void write( byte b[] ) 61 throws IOException 62 { 63 this.w.write( new String ( b ) ); 64 } 65 public void close() 66 throws IOException 67 { 68 this.w.close(); 69 } 70 public void flush() 71 throws IOException 72 { 73 this.w.flush(); 74 } 75 } 76 77 | Popular Tags |