public class UKSignaturesReader extends java.lang.Object implements java.util.Iterator<ObjectSignatureSQFD>, java.lang.AutoCloseable
Modifier and Type | Field and Description |
---|---|
protected FileChannelInputStream |
dataReader
Data reader
|
protected static int |
DEFAULT_BUFFER_SIZE
Default size of the reading buffer
|
protected java.lang.String |
fileName
Remembered name of opened file to provide reset capability
|
static int |
HEADER_SIZE_BYTES |
protected FileChannelInputStream |
headerReader
Header and directory reader
|
protected java.nio.channels.FileChannel |
channel
An input stream for reading objects of this iterator from
|
protected FileChannelInputStream |
locatorReader
Locator permutation reader
|
static int |
MAGIC_NUMBER |
protected ObjectSignatureSQFD |
nextObject
Instance of a next object.
|
protected int |
objectsRead
Number of objects read from the stream
|
protected long |
previousOffset
Offset of the previously read object
|
Constructor and Description |
---|
UKSignaturesReader(java.lang.String fileName)
Construct the reader with name of the binary file with UK-formated signature data file.
|
UKSignaturesReader(java.lang.String fileName,
java.lang.String locatorMappingFile)
Construct the reader with name of the binary file with UK-formated signature data file.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
hasNext() |
ObjectSignatureSQFD |
next() |
static void |
readAndPrintObjects(int objsToRead,
java.lang.String signatureFile) |
static void |
readAndPrintObjects(int objsToRead,
java.lang.String signatureFile,
java.lang.String permutationFile,
java.io.File outFIle) |
protected void |
readHeader(FileChannelInputStream header)
Structure of the head should be:
std::uint32_t mMagic; ///< Magic value for verification (must be equal to 0x1beddeed).
|
protected ObjectSignatureSQFD |
readNextObject() |
void |
remove() |
protected static final int DEFAULT_BUFFER_SIZE
protected java.nio.channels.FileChannel channel
protected java.lang.String fileName
protected FileChannelInputStream headerReader
protected FileChannelInputStream dataReader
protected FileChannelInputStream locatorReader
public static int HEADER_SIZE_BYTES
public static int MAGIC_NUMBER
protected ObjectSignatureSQFD nextObject
protected int objectsRead
protected long previousOffset
public UKSignaturesReader(java.lang.String fileName)
fileName
- UK-formated signature binary filepublic UKSignaturesReader(java.lang.String fileName, java.lang.String locatorMappingFile)
fileName
- UK-formated signature binary filelocatorMappingFile
- file with mapping between some original object locators and order of the objects in the data fileprotected final void readHeader(FileChannelInputStream header) throws java.io.IOException
java.io.IOException
protected ObjectSignatureSQFD readNextObject() throws java.io.IOException
java.io.IOException
public boolean hasNext()
hasNext
in interface java.util.Iterator<ObjectSignatureSQFD>
public ObjectSignatureSQFD next()
next
in interface java.util.Iterator<ObjectSignatureSQFD>
public void remove()
remove
in interface java.util.Iterator<ObjectSignatureSQFD>
public void close() throws java.io.IOException
close
in interface java.lang.AutoCloseable
java.io.IOException
public static void readAndPrintObjects(int objsToRead, java.lang.String signatureFile)
public static void readAndPrintObjects(int objsToRead, java.lang.String signatureFile, java.lang.String permutationFile, java.io.File outFIle)