public interface FileReading extends Closeable
Example:
final Media file = UtilityMedia.get("test.txt"); try (FileReading reading = File.createFileReading(file);) { reading.readBoolean(); reading.readByte(); reading.readChar(); reading.readShort(); reading.readInteger(); reading.readFloat(); reading.readLong(); reading.readDouble(); } catch (final IOException exception) { Assert.fail(exception.getMessage()); }
Modifier and Type | Method and Description |
---|---|
void |
close()
Terminate reading, close file.
|
boolean |
readBoolean()
Read a boolean (1 bit,
true or false ). |
byte |
readByte()
Read a byte (1 byte, -128 to 127 both included).
|
char |
readChar()
Read a char (2 bytes, 0 to 65535 both included).
|
double |
readDouble()
Read a double (8 bytes, 4.94065645841246544e-324 to 1.79769313486231570e+308 both included).
|
float |
readFloat()
Read a float (4 bytes, 1.40129846432481707e-45 to 3.40282346638528860e+38 both included).
|
int |
readInteger()
Read an integer (4 bytes, -2.147.483.648 to 2.147.483.647 both included).
|
long |
readLong()
Read a long (8 bytes, -9.223.372.036.854.775.808 to 9.223.372.036.854.775.807 both included).
|
short |
readShort()
Read a short (2 bytes, -32.768 to 32.767 both included).
|
String |
readString()
Read a sequence of characters (2 bytes and more).
|
boolean readBoolean() throws IOException
true
or false
).IOException
- If read failed.byte readByte() throws IOException
IOException
- If read failed.char readChar() throws IOException
IOException
- If read failed.short readShort() throws IOException
IOException
- If read failed.int readInteger() throws IOException
IOException
- If read failed.float readFloat() throws IOException
IOException
- If read failed.long readLong() throws IOException
IOException
- If read failed.double readDouble() throws IOException
IOException
- If read failed.String readString() throws IOException
IOException
- If read failed.void close() throws IOException
close
in interface AutoCloseable
close
in interface Closeable
IOException
- If close failed.Copyright © 2014 Byron 3D Games Studio. All rights reserved.