示例#1
0
 private void writeHeader() throws IOException {
   ByteBuffer buf = ByteBuffer.allocateDirect(BinaryHeader.HEADER_SIZE);
   BinaryHeader header = BinaryHeader.create(format, index, userMap.size(), itemMap.size());
   header.render(buf);
   buf.flip();
   BinaryUtils.writeBuffer(channel, buf, 0);
 }
示例#2
0
 public byte[] render() {
   ByteBuffer buf = ByteBuffer.allocate(HEADER_SIZE);
   render(buf);
   return buf.array();
 }