public class FileUtil
extends java.lang.Object
Constructor and Description |
---|
FileUtil() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
readBytes(java.io.File file)
Reads the contents of a
File into a byte[] . |
static byte[] |
readBytes(java.lang.String filePath)
Reads the contents of a
File into a byte[] . |
static void |
saveBytes(java.io.File file,
byte[] bytes)
Saves the contents of a
byte[] to the specified File . |
public static void saveBytes(java.io.File file, byte[] bytes) throws java.io.IOException
byte[]
to the specified File
.java.io.IOException
public static byte[] readBytes(java.io.File file) throws java.io.IOException
File
into a byte[]
. This relies upon File.length()
returning the correct value, which may not be the case when using a network file system. However this method is
intended for unit test support, in which case the files should be on the local volume.java.io.IOException
public static byte[] readBytes(java.lang.String filePath) throws java.io.IOException
File
into a byte[]
. This relies upon File.length()
returning the correct value, which may not be the case when using a network file system. However this method is
intended for unit test support, in which case the files should be on the local volume.java.io.IOException