Class B2IoUtils


  • public class B2IoUtils
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      B2IoUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void closeQuietly​(java.io.Closeable closeable)
      If closable isn't null, this will close it, ignoring any IOExceptions that might happen.
      static long copy​(java.io.InputStream in, java.io.OutputStream out)
      Copies the contents of 'in' to 'out' stopping when it hits the end of 'in' or when it hit an exception.
      static void readToEnd​(java.io.InputStream in)  
      • Methods inherited from class java.lang.Object

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

      • B2IoUtils

        public B2IoUtils()
    • Method Detail

      • copy

        public static long copy​(java.io.InputStream in,
                                java.io.OutputStream out)
                         throws java.io.IOException
        Copies the contents of 'in' to 'out' stopping when it hits the end of 'in' or when it hit an exception.
        Throws:
        java.io.IOException
      • closeQuietly

        public static void closeQuietly​(java.io.Closeable closeable)
        If closable isn't null, this will close it, ignoring any IOExceptions that might happen. This is especially useful in finally blocks.
        Parameters:
        closeable - the object to close.
      • readToEnd

        public static void readToEnd​(java.io.InputStream in)
                              throws java.io.IOException
        Throws:
        java.io.IOException