Package mgui.io.util
Class ByteOrderedFile
java.lang.Object
java.io.RandomAccessFile
mgui.io.util.ByteOrderedFile
- All Implemented Interfaces:
java.io.Closeable
,java.io.DataInput
,java.io.DataOutput
,java.lang.AutoCloseable
public class ByteOrderedFile
extends java.io.RandomAccessFile
Extends RandomAccessFile to support byte order. Why is this not already standard?
- Author:
- atreid
-
Field Summary
Fields Modifier and Type Field Description java.nio.ByteOrder
byteOrder
-
Constructor Summary
Constructors Constructor Description ByteOrderedFile(java.io.File file, java.lang.String mode)
ByteOrderedFile(java.lang.String name, java.lang.String mode)
-
Method Summary
Modifier and Type Method Description char
readOrderedChar()
double
readOrderedDouble()
float
readOrderedFloat()
int
readOrderedInt()
long
readOrderedLong()
void
setByteOrder(java.nio.ByteOrder bo)
void
writeOrderedChar(int v)
void
writeOrderedDouble(double v)
void
writeOrderedFloat(float v)
void
writeOrderedInt(int v)
void
writeOrderedLong(long v)
void
writeOrderedShort(int v)
Methods inherited from class java.io.RandomAccessFile
close, getChannel, getFD, getFilePointer, length, read, read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, seek, setLength, skipBytes, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
byteOrder
public java.nio.ByteOrder byteOrder
-
-
Constructor Details
-
ByteOrderedFile
public ByteOrderedFile(java.lang.String name, java.lang.String mode) throws java.io.FileNotFoundException- Throws:
java.io.FileNotFoundException
-
ByteOrderedFile
public ByteOrderedFile(java.io.File file, java.lang.String mode) throws java.io.FileNotFoundException- Throws:
java.io.FileNotFoundException
-
-
Method Details
-
setByteOrder
public void setByteOrder(java.nio.ByteOrder bo) -
readOrderedChar
public char readOrderedChar() throws java.io.IOException- Throws:
java.io.IOException
-
readOrderedInt
public final int readOrderedInt() throws java.io.IOException- Throws:
java.io.IOException
-
readOrderedLong
public final long readOrderedLong() throws java.io.IOException- Throws:
java.io.IOException
-
readOrderedFloat
public final float readOrderedFloat() throws java.io.IOException- Throws:
java.io.IOException
-
readOrderedDouble
public final double readOrderedDouble() throws java.io.IOException- Throws:
java.io.IOException
-
writeOrderedShort
public final void writeOrderedShort(int v) throws java.io.IOException- Throws:
java.io.IOException
-
writeOrderedChar
public final void writeOrderedChar(int v) throws java.io.IOException- Throws:
java.io.IOException
-
writeOrderedInt
public final void writeOrderedInt(int v) throws java.io.IOException- Throws:
java.io.IOException
-
writeOrderedLong
public final void writeOrderedLong(long v) throws java.io.IOException- Throws:
java.io.IOException
-
writeOrderedFloat
public final void writeOrderedFloat(float v) throws java.io.IOException- Throws:
java.io.IOException
-
writeOrderedDouble
public final void writeOrderedDouble(double v) throws java.io.IOException- Throws:
java.io.IOException
-