public final class FileUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
assertExists(File fsaFile,
boolean requireFile,
boolean requireDirectory)
Checks if the given file exists.
|
static void |
close(Closeable... closeables)
Force any non-null closeables.
|
static byte |
readByte(InputStream in)
Read exactly one byte from the input stream.
|
static byte[] |
readFully(InputStream stream)
Reads all bytes from an input stream (until EOF).
|
static void |
readFully(InputStream in,
byte[] array)
Read enough bytes to fill
array If there are not enough
bytes, throw an exception. |
static int |
readInt(InputStream in)
Read exactly 4 bytes from the input stream.
|
static short |
readShort(InputStream in)
Read exactly 2 bytes from the input stream.
|
static void |
writeInt(OutputStream os,
int v) |
static void |
writeShort(OutputStream os,
short v) |
public static void assertExists(File fsaFile, boolean requireFile, boolean requireDirectory) throws IOException
IOExceptionpublic static void close(Closeable... closeables)
public static byte[] readFully(InputStream stream) throws IOException
IOExceptionpublic static void readFully(InputStream in, byte[] array) throws IOException
array If there are not enough
bytes, throw an exception.IOExceptionpublic static int readInt(InputStream in) throws IOException
IOExceptionpublic static void writeInt(OutputStream os, int v) throws IOException
IOExceptionpublic static short readShort(InputStream in) throws IOException
IOExceptionpublic static byte readByte(InputStream in) throws IOException
EOFException - if EOF is reached.IOExceptionpublic static void writeShort(OutputStream os, short v) throws IOException
IOExceptionCopyright © 2015. All rights reserved.