decoder

package
v0.16.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 11, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package decoder reads pxar archives.

Package decoder reads pxar archives sequentially.

Decoder provides a streaming iterator (Next) over pxar archive entries. It handles both v1 and v2 formats, including optional FORMAT_VERSION headers and PRELUDE data.

Usage

dec := decoder.NewDecoder(reader, nil)
for {
    entry, err := dec.Next()
    if err == io.EOF {
        break
    }
    // process entry
}

For files that carry content, Contents returns an io.Reader to stream the payload. The decoder buffers minimal state; paths are tracked via length markers for efficient reset.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

type Decoder struct {
	// contains filtered or unexported fields
}

Decoder reads pxar archives sequentially.

func NewDecoder

func NewDecoder(input io.Reader, payloadReader io.Reader) *Decoder

NewDecoder creates a new pxar decoder.

func (*Decoder) Contents

func (d *Decoder) Contents() io.Reader

Contents returns a reader for the current file's content.

func (*Decoder) Next

func (d *Decoder) Next() (*pxar.Entry, error)

Next returns the next entry, or io.EOF when done.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL