I can now read the entire directory structure.

This commit is contained in:
Caleb Gardner
2020-11-19 13:27:13 -06:00
parent d43ed54874
commit 33af16071d
6 changed files with 67 additions and 16 deletions
-3
View File
@@ -4,7 +4,6 @@ import (
"bytes"
"encoding/binary"
"errors"
"fmt"
"io"
)
@@ -90,7 +89,6 @@ func (br *BlockReader) readNextDataBlock() error {
}
func (br *BlockReader) Read(p []byte) (int, error) {
fmt.Println("reading", len(p), "bytes")
if br.readOffset+len(p) < len(br.data) {
for i := 0; i < len(p); i++ {
p[i] = br.data[br.readOffset+i]
@@ -111,7 +109,6 @@ func (br *BlockReader) Read(p []byte) (int, error) {
return read, err
}
for ; read < len(p); read++ {
// fmt.Println("Reading...")
if br.readOffset+read < len(br.data) {
p[read] = br.data[br.readOffset+read]
} else {