Package io

Class BlockCopy


  • public class BlockCopy
    extends java.lang.Object
    Stream block copy example.
    Author:
    Georgiy Korneev
    • Constructor Summary

      Constructors 
      Constructor Description
      BlockCopy()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void copy​(java.io.InputStream is, java.io.OutputStream os)
      Performs a block copy of the input stream to the output stream.
      static void main​(java.lang.String[] args)
      Copies a file specified by the first argument to the file specified by the second argument.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BlockCopy

        public BlockCopy()
    • Method Detail

      • copy

        public static void copy​(java.io.InputStream is,
                                java.io.OutputStream os)
                         throws java.io.IOException
        Performs a block copy of the input stream to the output stream.
        Parameters:
        is - input stream to copy.
        os - output stream to copy to.
        Throws:
        java.io.IOException - if an I/O error occurred.
      • main

        public static void main​(java.lang.String[] args)
        Copies a file specified by the first argument to the file specified by the second argument.
        Parameters:
        args - command line arguments.