public class FilePosition extends Object implements BitFilePosition
Modifier and Type | Field and Description |
---|---|
byte |
Bits
The offset in bits within the pointed byte.
|
long |
Bytes
The offset within a file in bytes.
|
protected static int |
sizeInBytes
The number of bytes a file position could be converted to
- 8 for the byte's long, 1 for the bits
|
Constructor and Description |
---|
FilePosition()
Default constructor.
|
FilePosition(BitFilePosition in)
Create a new FilePosition based on an existing one
|
FilePosition(byte[] in)
Create an instance based on a byte buffer
|
FilePosition(long bytesPosition,
byte bitsPosition)
Creates an instance of the class from the given
byte and bit offsets.
|
Modifier and Type | Method and Description |
---|---|
void |
build(DataInput di)
unseralize this object from the named dataoutput instance
|
boolean |
equals(Object o)
Is this FilePosition equal to another?
|
long |
getOffset()
Return the offset
|
byte |
getOffsetBits()
Return the offset bits
|
int |
hashCode()
Define a hashcode for this - objects which defined equals(Object) should define
hashCode() also
|
void |
setOffset(BitFilePosition pos)
Set the offset
|
void |
setOffset(long bytes,
byte bits)
Set the offset in bytes and bits
|
static int |
sizeInBytes()
How large is this object when serialized
|
void |
toBytes(DataOutput dai)
Seralize this object to the named dataoutput instance
|
String |
toString()
String representation of this object
|
protected static final int sizeInBytes
public long Bytes
public byte Bits
public FilePosition()
public FilePosition(long bytesPosition, byte bitsPosition)
bytesPosition
- long the given byte offset.bitsPosition
- byte the given bit offset.public FilePosition(byte[] in)
public FilePosition(BitFilePosition in)
public long getOffset()
getOffset
in interface BitFilePosition
public byte getOffsetBits()
getOffsetBits
in interface BitFilePosition
public void setOffset(long bytes, byte bits)
setOffset
in interface BitFilePosition
public void setOffset(BitFilePosition pos)
setOffset
in interface BitFilePosition
public static int sizeInBytes()
public void toBytes(DataOutput dai)
public void build(DataInput di)
public boolean equals(Object o)
public int hashCode()
Terrier 4.0. Copyright © 2004-2014 University of Glasgow