src/main/java/org/jboss/util/stream/Streams.java
/**
    * Copy all of the bytes from the input stream to the output stream
    * wrapping streams in buffers as needed.
    *
    * @param input   Stream to read bytes from.
    * @param output  Stream to write bytes to.
    * @return        The total number of bytes copied.
    *
    * @throws IOException  Failed to copy bytes.
    */
Copy all of the bytes from the input stream to the output stream
wrapping streams in buffers as needed.

@param input   Stream to read bytes from.
@param output  Stream to write bytes to.
@return        The total number of bytes copied.

@throws IOException  Failed to copy bytes.
Copy all of the bytes from the input stream to the output stream wrapping streams in buffers as needed . @param input Stream to read bytes from . @param output Stream to write bytes to . @return The total number of bytes copied . @throws IOException Failed to copy bytes .
public static long copyb(InputStream input, 
                            OutputStream output)
      throws IOException
   {
      if (!(input instanceof BufferedInputStream)) {
         input = new BufferedInputStream(input);
      }
      if (!(output instanceof BufferedOutputStream)) {
         output = new BufferedOutputStream(output);
      }
      long bytes = copy(input, output, DEFAULT_BUFFER_SIZE);
      output.flush();
      return bytes;
   }
public static long copyb ( InputStream input , OutputStream output ) throws IOException { if ( ! ( input instanceof BufferedInputStream ) ) { input = new BufferedInputStream ( input ) ; } if ( ! ( output instanceof BufferedOutputStream ) ) { output = new BufferedOutputStream ( output ) ; } long bytes = copy ( input , output , DEFAULT_BUFFER_SIZE ) ; output . flush ( ) ; return bytes ; }
Copy all of the bytes from the input stream to the output stream
 wrapping streams in buffers as needed.
Copy all of the bytes from the input stream to the output stream wrapping streams in buffers as needed .