()
| 104 | } |
| 105 | |
| 106 | func (r *objectReader) openCurrentChunk() error { |
| 107 | st := r.seekTable[r.currentChunkIndex] |
| 108 | |
| 109 | rd, err := openAndAssertLength(r.ctx, r.cr, st.Object, st.Length) |
| 110 | if err != nil { |
| 111 | return err |
| 112 | } |
| 113 | |
| 114 | defer rd.Close() //nolint:errcheck |
| 115 | |
| 116 | b := make([]byte, st.Length) |
| 117 | if _, err := io.ReadFull(rd, b); err != nil { |
| 118 | return errors.Wrap(err, "error reading chunk") |
| 119 | } |
| 120 | |
| 121 | r.currentChunkData = b |
| 122 | r.currentChunkPosition = 0 |
| 123 | |
| 124 | return nil |
| 125 | } |
| 126 | |
| 127 | func (r *objectReader) closeCurrentChunk() { |
| 128 | r.currentChunkData = nil |
no test coverage detected