@Override
 public void start(IndexOutput termsOut) throws IOException {
   this.termsOut = termsOut;
   CodecUtil.writeHeader(termsOut, CODEC, VERSION_CURRENT);
   termsOut.writeVInt(pending.length); // encode maxPositions in header
   wrappedPostingsWriter.start(termsOut);
 }
 protected void writeTrailer(long dirStart) throws IOException {
   out.seek(CodecUtil.headerLength(CODEC_NAME));
   out.writeLong(dirStart);
 }
 protected void writeHeader(IndexOutput out) throws IOException {
   CodecUtil.writeHeader(out, CODEC_NAME, VERSION_CURRENT);
   // Placeholder for dir offset
   out.writeLong(0);
 }