From 81299c38723dda471c184128467adb3dbf6c5a79 Mon Sep 17 00:00:00 2001 From: Caleb Gardner Date: Tue, 10 Nov 2020 06:03:56 -0600 Subject: [PATCH] Added some TODOs --- compressionoptions.go | 2 +- unsquash.go | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/compressionoptions.go b/compressionoptions.go index 06ed4f5..65e604b 100644 --- a/compressionoptions.go +++ b/compressionoptions.go @@ -1,6 +1,6 @@ package squashfs -//CompressionOptions +//TODO: implement decompress for each type of Options type CompressionOptions interface { Decompress([]byte) []byte } diff --git a/unsquash.go b/unsquash.go index 0a41480..bcc3c20 100644 --- a/unsquash.go +++ b/unsquash.go @@ -7,17 +7,19 @@ import ( //Squashfs is a squashfs backed by a ReadSeeker. type Squashfs struct { - rdr *io.ReaderAt //underlying reader + rdr *io.ReadSeeker //underlying reader super Superblock } //NewSquashfs creates a new Squashfs backed by the given reader -func NewSquashfs(reader io.ReaderAt) (*Squashfs, error) { +func NewSquashfs(reader io.ReadSeeker) (*Squashfs, error) { var superblock Superblock - err := binary.Read(io.NewSectionReader(reader, 0, int64(binary.Size(superblock))), binary.LittleEndian, &superblock) + err := binary.Read(reader, binary.LittleEndian, &superblock) if err != nil { return nil, err } + //TODO: check magic + //TODO: parse more info return &Squashfs{ rdr: &reader, super: superblock,