public final class Sparkey extends Object
Modifier and Type | Method and Description |
---|---|
static SparkeyWriter |
append(File file)
Opens an existing file for append.
|
static SparkeyWriter |
appendOrCreate(File file,
CompressionType compressionType,
int compressionBlockSize)
Opens an existing file for append, or create a new one if it doesn't exist.
|
static SparkeyWriter |
createNew(File file)
Creates a new sparkey writer without any compression.
|
static SparkeyWriter |
createNew(File file,
CompressionType compressionType,
int compressionBlockSize)
Creates a new sparkey writer with the specified compression
This is not a thread-safe class, only use it from one thread.
|
static File |
getIndexFile(File file)
Sets the file ending of the file to .spi (the index filename convention)
|
static IndexHeader |
getIndexHeader(File file)
Extract the header information from the index file.
|
static File |
getLogFile(File file)
Sets the file ending of the file to .spl (the log filename convention)
|
static LogHeader |
getLogHeader(File file)
Extract the header information from the log file.
|
static SparkeyReader |
open(File file)
Open a new sparkey reader
This is not a thread-safe class, only use it from one thread.
|
static void |
writeHash(File file)
Write (or rewrite) the index file for a given sparkey file.
|
static void |
writeHash(File file,
HashType hashType)
Write (or rewrite) the index file for a given sparkey file.
|
public static SparkeyWriter createNew(File file) throws IOException
file
- File base to use, the actual file endings will be set to .spi and .splIOException
public static SparkeyWriter createNew(File file, CompressionType compressionType, int compressionBlockSize) throws IOException
file
- File base to use, the actual file endings will be set to .spi and .splcompressionType
- compressionBlockSize
- The maximum compression block size in bytesIOException
public static SparkeyWriter append(File file) throws IOException
file
- File base to use, the actual file endings will be set to .spi and .splIOException
public static SparkeyWriter appendOrCreate(File file, CompressionType compressionType, int compressionBlockSize) throws IOException
file
- File base to use, the actual file endings will be set to .spi and .splcompressionType
- compressionBlockSize
- The maximum compression block size in bytesIOException
public static SparkeyReader open(File file) throws IOException
file
- File base to use, the actual file endings will be set to .spi and .splIOException
public static void writeHash(File file) throws IOException
file
- File base to use, the actual file endings will be set to .spi and .splIOException
public static void writeHash(File file, HashType hashType) throws IOException
file
- File base to use, the actual file endings will be set to .spi and .splhashType
- choice of hash type, can be 32 or 64 bits.IOException
public static File getLogFile(File file)
file
- public static File getIndexFile(File file)
file
- public static IndexHeader getIndexHeader(File file) throws IOException
file
- IOException
public static LogHeader getLogHeader(File file) throws IOException
file
- IOException
Copyright © 2013. All rights reserved.