code: func (cmd *DumpCommand) PrintPage(w io.Writer, r io.ReaderAt, pageID int, pageSize int) error {
  	const bytesPerLineN = 16
  
  	// Read page into buffer.
  	buf := make([]byte, pageSize)
  	addr := pageID * pageSize
  	if n, err := r.ReadAt(buf, int64(addr)); err != nil {
  		return err
  	} else if n != pageSize {
  		return io.ErrUnexpectedEOF
  	}
  
  	// Write out to writer in 16-byte lines.
  	var prev []byte
  	var skipped bool
  	for offset := 0; offset < pageSize; offset += bytesPerLineN {
  		// Retrieve current 16-byte line.
  		line := buf[offset : offset+bytesPerLineN]
  		isLastLine := (offset == (pageSize - bytesPerLineN))
  
  		// If it's the same as the previous line then print a skip.
  		if bytes.Equal(line, prev) && !isLastLine {
  			if !skipped {
  				fmt.Fprintf(w, "%07x *\n", addr+offset)
  				skipped = true
  			}
  		} else {
  			// Print line as hexadecimal in 2-byte groups.
  			fmt.Fprintf(w, "%07x %04x %04x %04x %04x %04x %04x %04x %04x\n", addr+offset,
  				line[0:2], line[2:4], line[4:6], line[6:8],
  				line[8:10], line[10:12], line[12:14], line[14:16],
  			)
  
  			skipped = false
  		}
  
  		// Save the previous line.
  		prev = line
  	}
  	fmt.Fprint(w, "\n")
  
  	return nil
  }
docs: // PrintPage prints a given page as hexadecimal.