Class FileCopyUtils
- java.lang.Object
-
- io.avaje.classpath.scanner.internal.FileCopyUtils
-
public class FileCopyUtils extends Object
Utility class for copying files and their contents. Inspired by Spring's own.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]copyToByteArray(InputStream in)Copy the contents of the given InputStream into a new byte array.static StringcopyToString(Reader in)Copy the contents of the given Reader into a String.
-
-
-
Method Detail
-
copyToString
public static String copyToString(Reader in) throws IOException
Copy the contents of the given Reader into a String. Closes the reader when done.- Parameters:
in- the reader to copy from- Returns:
- the String that has been copied to
- Throws:
IOException- in case of I/O errors
-
copyToByteArray
public static byte[] copyToByteArray(InputStream in) throws IOException
Copy the contents of the given InputStream into a new byte array. Closes the stream when done.- Parameters:
in- the stream to copy from- Returns:
- the new byte array that has been copied to
- Throws:
IOException- in case of I/O errors
-
-