Documentation ¶
Overview ¶
Package cabfile provides a bare minimum implementation of a parser for the Microsoft Cabinet file format. Its goal is to support the feature set of Cabinet files produced by gcab for the LVFS project.
Normative references for this implementation are MS-CAB for the Cabinet file format and MS-MCI for the Microsoft ZIP Compression and Decompression Data Structure.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExactReader ¶
func ExactReader(r io.Reader, n int64) io.ReadCloser
ExactReader returns a Reader that reads from r but stops with EOF after n bytes. It returns ErrUnexpectedEOF if the underlying reader returns EOF before n bytes. The underlying implementation is a *ExactReader.
Types ¶
type Cabinet ¶
type Cabinet struct {
// contains filtered or unexported fields
}
Cabinet provides read-only access to Microsoft Cabinet files.
func New ¶
func New(r io.ReadSeeker) (*Cabinet, error)
New returns a new Cabinet with the header structures parsed and sanity checked.
func (*Cabinet) Content ¶
Content returns the content of the file specified by its filename as an io.Reader. Note that the entire folder which contains the file in question is decompressed for every file request.
type ExactReaderImpl ¶
A ExactReaderImpl reads from R but limits the amount of data returned to just N bytes. Each call to Read updates N to reflect the new amount remaining. Read returns EOF when N <= 0 or when the underlying R returns EOF.
func (*ExactReaderImpl) Close ¶
func (e *ExactReaderImpl) Close() error