Write writes a hint entry to the file
(entry *HintEntry)
| 428 | |
| 429 | // Write writes a hint entry to the file |
| 430 | func (w *HintFileWriter) Write(entry *HintEntry) error { |
| 431 | if entry == nil { |
| 432 | return ErrHintFileEntryInvalid |
| 433 | } |
| 434 | |
| 435 | data := entry.Encode() |
| 436 | _, err := w.writer.Write(data) |
| 437 | return err |
| 438 | } |
| 439 | |
| 440 | // Sync flushes the buffer and syncs the file to disk |
| 441 | func (w *HintFileWriter) Sync() error { |