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
IOException
public static void close(Closeable... closeables)
public static byte[] readFully(InputStream stream) throws IOException
IOException
public static void readFully(InputStream in, byte[] array) throws IOException
array
If there are not enough
bytes, throw an exception.IOException
public static int readInt(InputStream in) throws IOException
IOException
public static void writeInt(OutputStream os, int v) throws IOException
IOException
public static short readShort(InputStream in) throws IOException
IOException
public static byte readByte(InputStream in) throws IOException
EOFException
- if EOF is reached.IOException
public static void writeShort(OutputStream os, short v) throws IOException
IOException
Copyright © 2014. All rights reserved.