@NotThreadSafe public class BinaryRatingPacker extends Object implements Closeable
Creates rating pack files for the BinaryRatingDAO
.
Modifier and Type | Method and Description |
---|---|
void |
close() |
int |
getRatingCount() |
static BinaryRatingPacker |
open(File file,
BinaryFormatFlag... flags)
Open a new binary rating packer.
|
static BinaryRatingPacker |
open(File file,
EnumSet<BinaryFormatFlag> flags)
Open a new binary rating packer.
|
void |
writeRating(Rating rating) |
void |
writeRatings(Iterable<? extends Rating> ratings) |
public static BinaryRatingPacker open(File file, BinaryFormatFlag... flags) throws IOException
Open a new binary rating packer.
file
- The output file.flags
- The flags to use when creating the file.IOException
- The output exception.public static BinaryRatingPacker open(File file, EnumSet<BinaryFormatFlag> flags) throws IOException
Open a new binary rating packer.
file
- The output file.flags
- The flags to use when creating the file.IOException
- The output exception.public void writeRating(Rating rating) throws IOException
IOException
public void writeRatings(Iterable<? extends Rating> ratings) throws IOException
IOException
public int getRatingCount()
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException