FileDocCategorySizeDatePackage
BufferedStreamCopier.javaAPI DocExample616Sat Feb 04 05:47:52 GMT 2006com.elharo.io

BufferedStreamCopier

public class BufferedStreamCopier extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidcopy(java.io.InputStream in, java.io.OutputStream out)


    BufferedInputStream bin = new BufferedInputStream(in);
    BufferedOutputStream bout = new BufferedOutputStream(out);

    while (true) {
      int datum = bin.read();
      if (datum == -1) break;
      bout.write(datum);
    }
    bout.flush();
  
public static voidmain(java.lang.String[] args)


    try {
      copy(System.in, System.out);
    }
    catch (IOException ex) {
      System.err.println(ex);
    }