code: func (w *Writer) fillHeader(last bool) {
  	if w.i+headerSize > w.j || w.j > blockSize {
  		panic("leveldb/journal: bad writer state")
  	}
  	if last {
  		if w.first {
  			w.buf[w.i+6] = fullChunkType
  		} else {
  			w.buf[w.i+6] = lastChunkType
  		}
  	} else {
  		if w.first {
  			w.buf[w.i+6] = firstChunkType
  		} else {
  			w.buf[w.i+6] = middleChunkType
  		}
  	}
  	binary.LittleEndian.PutUint32(w.buf[w.i+0:w.i+4], util.NewCRC(w.buf[w.i+6:w.j]).Value())
  	binary.LittleEndian.PutUint16(w.buf[w.i+4:w.i+6], uint16(w.j-w.i-headerSize))
  }
docs: // fillHeader fills in the header for the pending chunk.