public class FileUtil extends Object
FileUtil class.
| Constructor and Description |
|---|
FileUtil() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
readFile(File file)
Reads entire binary file.
|
static byte[] |
readFile(URL url)
Reads entire binary file to a byte array.
|
static byte[] |
readStream(InputStream is)
Reads entire binary file to a byte array.
|
static void |
writeFile(File file,
byte[] data)
Creates and writes a binary file.
|
public static byte[] readFile(File file) throws IOException
file - fileIOException - on i/o problemspublic static byte[] readFile(URL url) throws IOException
url - a URL object.IOException - on i/o problemspublic static byte[] readStream(InputStream is) throws IOException
is - input streamIOException - on i/o problemspublic static void writeFile(File file, byte[] data) throws IOException
file - filedata - dataIOException - on i/o problemsCopyright © 2026. All rights reserved.