* file already exists.
*/
private static MappedByteBuffer createMappedBuffer(@Nonnull File file, int capacity, boolean newFile) {
try {
if (newFile && file.exists() && file.length() > 0) {
throw new FileAlreadyExistsException(file.getPath());
}
return new RandomAccessFile(file, "rw").getChannel().
map(FileChannel.MapMode.READ_WRITE, 0, Character.SIZE / Byte.SIZE * capacity);
} catch (IOException e) {
throw new UncheckedIOException(e);