public List<Integer> store(Paged paged, int page, T data) {
// The node will be stored in an extent. This allows us to easily
// support huge nodes.
// The first extent is only 1 page long, extents linked off
// the first page will be up to 128 pages long.
ExtentOutputStream eos = new ExtentOutputStream(paged, page, (short) 1, (short) 128);
DataOutputStream os = new DataOutputStream(eos);
try {
encode(paged, os, data);
os.close();
} catch (IOException e) {
throw new IndexException(e);
}
Ranges pages = eos.getPages();
pages.remove(page);
if (pages.isEmpty()) {
return Collections.emptyList();
}