Package org.cakelab.blender.io.block
Class Block
- java.lang.Object
-
- org.cakelab.blender.io.block.Block
-
- All Implemented Interfaces:
java.lang.Comparable<java.lang.Long>
public class Block extends java.lang.Object implements java.lang.Comparable<java.lang.Long>
An instance of this class provides access to data in a block of aBlenderFile
.- Author:
- homac
-
-
Field Summary
Fields Modifier and Type Field Description CDataReadWriteAccess
data
raw data in a byte order aware buffer.BlockHeader
header
the header as read from the file
-
Constructor Summary
Constructors Constructor Description Block(BlockHeader header, CDataReadWriteAccess data)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
int
compareTo(java.lang.Long address)
boolean
contains(long address)
void
flush(CDataReadWriteAccess io)
java.nio.ByteOrder
getByteOrder()
boolean
readBoolean(long address)
byte
readByte(long address)
double
readDouble(long address)
float
readFloat(long address)
void
readFully(long address, byte[] b)
void
readFully(long address, byte[] b, int off, int len)
void
readFully(long address, double[] b, int off, int len)
void
readFully(long address, float[] b, int off, int len)
void
readFully(long address, int[] b, int off, int len)
void
readFully(long address, long[] b, int off, int len)
void
readFully(long address, short[] b, int off, int len)
void
readFullyInt64(long address, long[] b, int off, int len)
int
readInt(long address)
long
readInt64(long address)
long
readLong(long address)
short
readShort(long address)
void
writeBoolean(long address, boolean value)
void
writeByte(long address, byte value)
void
writeDouble(long address, double value)
void
writeFloat(long address, float value)
void
writeFully(long address, byte[] b)
void
writeFully(long address, byte[] b, int off, int len)
void
writeFully(long address, double[] b, int off, int len)
void
writeFully(long address, float[] b, int off, int len)
void
writeFully(long address, int[] b, int off, int len)
void
writeFully(long address, long[] b, int off, int len)
void
writeFully(long address, short[] b, int off, int len)
void
writeFullyInt64(long address, long[] b, int off, int len)
void
writeInt(long address, int value)
void
writeInt64(long address, long value)
void
writeLong(long address, long value)
void
writeShort(long address, short value)
-
-
-
Field Detail
-
header
public BlockHeader header
the header as read from the file
-
data
public CDataReadWriteAccess data
raw data in a byte order aware buffer.
-
-
Constructor Detail
-
Block
public Block(BlockHeader header, CDataReadWriteAccess data)
-
-
Method Detail
-
compareTo
public int compareTo(java.lang.Long address)
- Specified by:
compareTo
in interfacejava.lang.Comparable<java.lang.Long>
-
close
public void close() throws java.io.IOException
- Throws:
java.io.IOException
-
readBoolean
public boolean readBoolean(long address) throws java.io.IOException
- Throws:
java.io.IOException
-
writeBoolean
public void writeBoolean(long address, boolean value) throws java.io.IOException
- Throws:
java.io.IOException
-
readByte
public byte readByte(long address) throws java.io.IOException
- Throws:
java.io.IOException
-
writeByte
public void writeByte(long address, byte value) throws java.io.IOException
- Throws:
java.io.IOException
-
readShort
public short readShort(long address) throws java.io.IOException
- Throws:
java.io.IOException
-
writeShort
public void writeShort(long address, short value) throws java.io.IOException
- Throws:
java.io.IOException
-
readInt
public int readInt(long address) throws java.io.IOException
- Throws:
java.io.IOException
-
writeInt
public void writeInt(long address, int value) throws java.io.IOException
- Throws:
java.io.IOException
-
readLong
public long readLong(long address) throws java.io.IOException
- Throws:
java.io.IOException
-
writeLong
public void writeLong(long address, long value) throws java.io.IOException
- Throws:
java.io.IOException
-
readInt64
public long readInt64(long address) throws java.io.IOException
- Throws:
java.io.IOException
-
writeInt64
public void writeInt64(long address, long value) throws java.io.IOException
- Throws:
java.io.IOException
-
readFloat
public float readFloat(long address) throws java.io.IOException
- Throws:
java.io.IOException
-
writeFloat
public void writeFloat(long address, float value) throws java.io.IOException
- Throws:
java.io.IOException
-
readDouble
public double readDouble(long address) throws java.io.IOException
- Throws:
java.io.IOException
-
writeDouble
public void writeDouble(long address, double value) throws java.io.IOException
- Throws:
java.io.IOException
-
readFully
public void readFully(long address, byte[] b) throws java.io.IOException
- Throws:
java.io.IOException
-
writeFully
public void writeFully(long address, byte[] b) throws java.io.IOException
- Throws:
java.io.IOException
-
readFully
public void readFully(long address, byte[] b, int off, int len) throws java.io.IOException
- Throws:
java.io.IOException
-
writeFully
public void writeFully(long address, byte[] b, int off, int len) throws java.io.IOException
- Throws:
java.io.IOException
-
contains
public boolean contains(long address)
-
readFully
public void readFully(long address, short[] b, int off, int len) throws java.io.IOException
- Throws:
java.io.IOException
-
writeFully
public void writeFully(long address, short[] b, int off, int len) throws java.io.IOException
- Throws:
java.io.IOException
-
readFully
public void readFully(long address, int[] b, int off, int len) throws java.io.IOException
- Throws:
java.io.IOException
-
writeFully
public void writeFully(long address, int[] b, int off, int len) throws java.io.IOException
- Throws:
java.io.IOException
-
readFully
public void readFully(long address, long[] b, int off, int len) throws java.io.IOException
- Throws:
java.io.IOException
-
writeFully
public void writeFully(long address, long[] b, int off, int len) throws java.io.IOException
- Throws:
java.io.IOException
-
readFullyInt64
public void readFullyInt64(long address, long[] b, int off, int len) throws java.io.IOException
- Throws:
java.io.IOException
-
writeFullyInt64
public void writeFullyInt64(long address, long[] b, int off, int len) throws java.io.IOException
- Throws:
java.io.IOException
-
readFully
public void readFully(long address, float[] b, int off, int len) throws java.io.IOException
- Throws:
java.io.IOException
-
writeFully
public void writeFully(long address, float[] b, int off, int len) throws java.io.IOException
- Throws:
java.io.IOException
-
readFully
public void readFully(long address, double[] b, int off, int len) throws java.io.IOException
- Throws:
java.io.IOException
-
writeFully
public void writeFully(long address, double[] b, int off, int len) throws java.io.IOException
- Throws:
java.io.IOException
-
getByteOrder
public java.nio.ByteOrder getByteOrder()
-
flush
public void flush(CDataReadWriteAccess io) throws java.io.IOException
- Throws:
java.io.IOException
-
-