Package 

Class StreamUtils


  • 
    public class StreamUtils
    
                        

    don't use android classes here, since this class is used outside of android

    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final static int IO_BUFFER_SIZE
    • Method Summary

      Modifier and Type Method Description
      static long copy(InputStream in, OutputStream out) Copy the content of the input stream into the output stream, using a temporary byte arraybuffer whose size is defined by IO_BUFFER_SIZE.
      static void closeStream(Closeable stream) Closes the specified stream.
      • Methods inherited from class java.lang.Object

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

      • copy

         static long copy(InputStream in, OutputStream out)

        Copy the content of the input stream into the output stream, using a temporary byte arraybuffer whose size is defined by IO_BUFFER_SIZE.

        Parameters:
        in - The input stream to copy from.
        out - The output stream to copy to.
      • closeStream

         static void closeStream(Closeable stream)

        Closes the specified stream.

        Parameters:
        stream - The stream to close.