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