public HtmlEntry(Dictionary dictionary, RandomAccessFile raf, final int index) throws IOException {
super(dictionary, raf, index);
title = raf.readUTF();
- html = raf.readUTF();
+ final boolean compressed = raf.readBoolean();
+ final int length = raf.readInt();
+ final byte[] bytes = new byte[length];
+ raf.readFully(bytes);
+ html = new String(bytes, "UTF-8");
}
@Override
public void write(RandomAccessFile raf) throws IOException {
super.write(raf);
raf.writeUTF(title);
- raf.writeUTF(html);
+ raf.writeBoolean(false);
+ final byte[] bytes = html.getBytes("UTF-8");
+ raf.writeInt(bytes.length);
+ raf.write(bytes);
}
@Override