Package com.backblaze.b2.util
Class B2IoUtils
- java.lang.Object
-
- com.backblaze.b2.util.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)
-
-
-
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
-
-