Package crosby.binary.file
Class FileBlockPosition
- java.lang.Object
-
- crosby.binary.file.FileBlockBase
-
- crosby.binary.file.FileBlockPosition
-
- Direct Known Subclasses:
FileBlockReference
public class FileBlockPosition extends FileBlockBase
Stores the position in the stream of a fileblock so that it can be easily read in a random-access fashion. We can turn this into a 'real' block by appropriately seeking into the file and doing a 'read'.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) long
data_offset
Offset into the file of the data part of the blockprotected int
datasize
-
Fields inherited from class crosby.binary.file.FileBlockBase
indexdata, MAX_BODY_SIZE, MAX_HEADER_SIZE, type
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
FileBlockPosition(java.lang.String type, com.google.protobuf.ByteString indexdata)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getDatasize()
(package private) static FileBlockPosition
newInstance(FileBlockBase base, long offset, int length)
(package private) FileBlock
parseData(byte[] buf)
Parse out and decompress the data part of a fileblock helper function.(package private) static FileBlockPosition
parseFrom(com.google.protobuf.ByteString b)
TODO: Parse a serialized representation of this block referenceFileBlock
read(java.io.InputStream input)
com.google.protobuf.ByteString
serialize()
TODO: Convert this reference into a serialized representation that can be stored.-
Methods inherited from class crosby.binary.file.FileBlockBase
getIndexData, getType
-
-
-
-
Method Detail
-
parseData
FileBlock parseData(byte[] buf) throws com.google.protobuf.InvalidProtocolBufferException
Parse out and decompress the data part of a fileblock helper function.- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
getDatasize
public int getDatasize()
-
newInstance
static FileBlockPosition newInstance(FileBlockBase base, long offset, int length)
-
read
public FileBlock read(java.io.InputStream input) throws java.io.IOException
- Throws:
java.io.IOException
-
serialize
public com.google.protobuf.ByteString serialize()
TODO: Convert this reference into a serialized representation that can be stored.
-
parseFrom
static FileBlockPosition parseFrom(com.google.protobuf.ByteString b)
TODO: Parse a serialized representation of this block reference
-
-