Package crosby.binary.file
Class FileBlockHead
- java.lang.Object
-
- crosby.binary.file.FileBlockBase
-
- crosby.binary.file.FileBlockPosition
-
- crosby.binary.file.FileBlockReference
-
- crosby.binary.file.FileBlockHead
-
public class FileBlockHead extends FileBlockReference
Intermediate representation of the header of a fileblock when a set of fileblocks is read as in a stream. The data in the fileblock must be either skipped (where the returned value is a reference to the fileblock) or parsed.
-
-
Field Summary
-
Fields inherited from class crosby.binary.file.FileBlockReference
input
-
Fields inherited from class crosby.binary.file.FileBlockPosition
data_offset, datasize
-
Fields inherited from class crosby.binary.file.FileBlockBase
indexdata, MAX_BODY_SIZE, MAX_HEADER_SIZE, type
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
FileBlockHead(java.lang.String type, com.google.protobuf.ByteString indexdata)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) FileBlock
readContents(java.io.InputStream input)
Assumes the stream is positioned over at the start of the data, read it and return the complete FileBlock(package private) static FileBlockHead
readHead(java.io.InputStream input)
Read the header.(package private) void
skipContents(java.io.InputStream input)
Assumes the stream is positioned over at the start of the data, skip over it.-
Methods inherited from class crosby.binary.file.FileBlockReference
newInstance, read
-
Methods inherited from class crosby.binary.file.FileBlockPosition
getDatasize, newInstance, parseData, parseFrom, read, serialize
-
Methods inherited from class crosby.binary.file.FileBlockBase
getIndexData, getType
-
-
-
-
Method Detail
-
readHead
static FileBlockHead readHead(java.io.InputStream input) throws java.io.IOException
Read the header. After reading the header, either the contents must be skipped or read- Throws:
java.io.IOException
-
skipContents
void skipContents(java.io.InputStream input) throws java.io.IOException
Assumes the stream is positioned over at the start of the data, skip over it.- Throws:
java.io.IOException
-
readContents
FileBlock readContents(java.io.InputStream input) throws java.io.IOException
Assumes the stream is positioned over at the start of the data, read it and return the complete FileBlock- Throws:
java.io.IOException
-
-