Package io.bdeploy.common.util
Class StreamHelper
java.lang.Object
io.bdeploy.common.util.StreamHelper
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidCloses the given object without throwing anIOExceptionexception.static longcopy(InputStream source, OutputStream sink) Copies the given input stream to the given output stream.static booleanDetermine whether a file is text or binary.static byte[]read(InputStream source) Fully reads the givenInputStreaminto a byte[].
-
Method Details
-
copy
Copies the given input stream to the given output stream.- Throws:
IOException
-
read
Fully reads the givenInputStreaminto a byte[].- Throws:
IOException
-
isTextFile
Determine whether a file is text or binary. This is done by scanning for 'zero' bytes in the contents.- Throws:
IOException
-
close
Closes the given object without throwing anIOExceptionexception.
-