Extracting is mostly finished.

Fixed reading metadata and data blocks that are the exactly correct size
This commit is contained in:
Caleb Gardner
2020-12-02 01:05:31 -06:00
parent 28bb0f873a
commit fef7bec20d
5 changed files with 67 additions and 41 deletions
+5 -2
View File
@@ -153,9 +153,12 @@ func (d *dataReader) Close() error {
func (d *dataReader) Read(p []byte) (int, error) {
if d.curData == nil {
d.readCurBlock()
err := d.readCurBlock()
if err != nil {
return 0, err
}
}
if d.curReadOffset+len(p) < len(d.curData) {
if d.curReadOffset+len(p) <= len(d.curData) {
for i := 0; i < len(p); i++ {
p[i] = d.curData[d.curReadOffset+i]
}