Package org.cakelab.blender.io.util
Class LittleEndianFileRW
- java.lang.Object
-
- org.cakelab.blender.io.util.CDataReadWriteAccess
-
- org.cakelab.blender.io.util.CDataFileRWAccess
-
- org.cakelab.blender.io.util.LittleEndianFileRW
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class LittleEndianFileRW extends CDataFileRWAccess
-
-
Field Summary
-
Fields inherited from class org.cakelab.blender.io.util.CDataFileRWAccess
io
-
-
Constructor Summary
Constructors Constructor Description LittleEndianFileRW(java.io.RandomAccessFile in, int pointerSize)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.nio.ByteOrder
getByteOrder()
double
readDouble()
float
readFloat()
int
readInt()
long
readInt64()
short
readShort()
static double
swapDouble(double value)
Converts a "double" value between endian systems.static float
swapFloat(float value)
Converts a "float" value between endian systems.static int
swapInteger(int value)
Converts a "int" value between endian systems.static long
swapLong(long value)
Converts a "long" value between endian systems.static short
swapShort(short value)
Converts a "short" value between endian systems.void
writeDouble(double value)
void
writeFloat(float value)
void
writeInt(int value)
void
writeInt64(long value)
void
writeShort(short value)
-
Methods inherited from class org.cakelab.blender.io.util.CDataFileRWAccess
available, close, offset, offset, padding, padding, readBoolean, readByte, readFully, skip, writeBoolean, writeByte, writeFully
-
Methods inherited from class org.cakelab.blender.io.util.CDataReadWriteAccess
create, create, getPointerSize, readFully, readFully, readFully, readFully, readFully, readFully, readFullyInt64, readLong, writeFully, writeFully, writeFully, writeFully, writeFully, writeFully, writeFullyInt64, writeLong
-
-
-
-
Method Detail
-
readShort
public final short readShort() throws java.io.IOException
- Specified by:
readShort
in classCDataReadWriteAccess
- Throws:
java.io.IOException
-
writeShort
public final void writeShort(short value) throws java.io.IOException
- Specified by:
writeShort
in classCDataReadWriteAccess
- Throws:
java.io.IOException
-
readInt
public final int readInt() throws java.io.IOException
- Specified by:
readInt
in classCDataReadWriteAccess
- Throws:
java.io.IOException
-
writeInt
public final void writeInt(int value) throws java.io.IOException
- Specified by:
writeInt
in classCDataReadWriteAccess
- Throws:
java.io.IOException
-
readInt64
public final long readInt64() throws java.io.IOException
- Specified by:
readInt64
in classCDataReadWriteAccess
- Throws:
java.io.IOException
-
writeInt64
public final void writeInt64(long value) throws java.io.IOException
- Specified by:
writeInt64
in classCDataReadWriteAccess
- Throws:
java.io.IOException
-
readFloat
public final float readFloat() throws java.io.IOException
- Specified by:
readFloat
in classCDataReadWriteAccess
- Throws:
java.io.IOException
-
writeFloat
public final void writeFloat(float value) throws java.io.IOException
- Specified by:
writeFloat
in classCDataReadWriteAccess
- Throws:
java.io.IOException
-
readDouble
public final double readDouble() throws java.io.IOException
- Specified by:
readDouble
in classCDataReadWriteAccess
- Throws:
java.io.IOException
-
writeDouble
public final void writeDouble(double value) throws java.io.IOException
- Specified by:
writeDouble
in classCDataReadWriteAccess
- Throws:
java.io.IOException
-
swapShort
public static short swapShort(short value)
Converts a "short" value between endian systems.- Parameters:
value
- value to convert- Returns:
- the converted value
-
swapInteger
public static int swapInteger(int value)
Converts a "int" value between endian systems.- Parameters:
value
- value to convert- Returns:
- the converted value
-
swapLong
public static long swapLong(long value)
Converts a "long" value between endian systems.- Parameters:
value
- value to convert- Returns:
- the converted value
-
swapFloat
public static float swapFloat(float value)
Converts a "float" value between endian systems.- Parameters:
value
- value to convert- Returns:
- the converted value
-
swapDouble
public static double swapDouble(double value)
Converts a "double" value between endian systems.- Parameters:
value
- value to convert- Returns:
- the converted value
-
getByteOrder
public java.nio.ByteOrder getByteOrder()
- Specified by:
getByteOrder
in classCDataReadWriteAccess
-
-