Szip

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: MIT Imports: 8 Imported by: 0

README

Szip

간단화한 Zip64 컨테이너 형식을 읽고 쓰는 모듈입니다. Zip64는 압축이 가능하지만 형식이 복잡하여 일부 경우에는 안정성이 떨어질 수 있습니다. 데이터를 로드하면 전체 파일의 이름과 크기가 필드에 저장됩니다. 이후 n번째 파일을 읽거나 열어 사용합니다.

Module for reading and writing a simplified Zip64 container format. Zip64 supports compression, but its complex format may reduce stability in some cases. Loading data stores the names and sizes of all files in fields. You can then read or open the n-th file.

python
class ZipWriter:
    def __init__(output: str, compress: bool)
    def writefile(name: str, path: str)
    def writebin(name: str, data: bytes)
    def close() -> bytes

class ZipReader:
    def __init__(input: str | bytes)
    names: list[str]
    sizes: list[int]
    def read(idx: int) -> bytes
    def open(idx: int) -> io.IOBase
    def close()

Pack(srcs: str|list[str], dst: str) -> None
Unpack(src: str, dst: str) -> None
javascript
class ZipWriter {
    constructor(output: string, compress: boolean)
    async function writefile(name: string, src: string | Blob | File)
    function writebin(name: string, data: Uint8Array | string | Blob)
    async function close(): Uint8Array | null
}

class ZipReader {
    constructor(input: string | Blob | Uint8Array)
    names: string[]
    sizes: number[]
    async function init()
    async function read(idx: number): Uint8Array
    function close()
}
golang
struct ZipWriter {
    func Init(output string, compress bool) error
    func WriteFile(name string, path string) error
    func WriteBin(name string, data []byte) error
    func Close() ([]byte, error)
}

struct ZipReader {
    Names []string
    Sizes []int64
    func Init(input interface{}) error
    func Read(idx int) ([]byte, error)
    func Open(idx int) (io.ReadCloser, error)
    func Close() error
}

func Pack(srcs []string, dst string) error
func Unpack(src string, dst string) error
java
class Szip {
    static class ZipWriter implements Closeable {
        void openWriter(File file, boolean compress)
        void write(String name, byte[] data)
        void write(String name, File file)
        void write(String name, InputStream inputStream)
        byte[] closeZip()
        void close()
    }

    static class ZipReader implements Closeable {
        List<String> names
        List<Long> sizes
        
        void open(File file)
        void open(byte[] data)
        byte[] read(int idx)
        InputStream open(int idx)
        byte[] closeZip()
        void close()
    }
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Pack added in v0.2.0

func Pack(srcs []string, dst string) error

func Unpack added in v0.2.0

func Unpack(src string, dst string) error

Types

type ZipReader

type ZipReader struct {
	Names []string
	Sizes []int64
	// contains filtered or unexported fields
}

Zip64 Reader

func (*ZipReader) Close

func (z *ZipReader) Close() error

func (*ZipReader) Init

func (z *ZipReader) Init(input interface{}) error

func (*ZipReader) Open

func (z *ZipReader) Open(idx int) (io.ReadCloser, error)

func (*ZipReader) Read

func (z *ZipReader) Read(idx int) ([]byte, error)

type ZipWriter

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

Zip64 Writer

func (*ZipWriter) Close

func (z *ZipWriter) Close() ([]byte, error)

func (*ZipWriter) Init

func (z *ZipWriter) Init(output string, compress bool) error

func (*ZipWriter) WriteBin

func (z *ZipWriter) WriteBin(name string, data []byte) error

func (*ZipWriter) WriteFile

func (z *ZipWriter) WriteFile(name string, path string) error

Jump to

Keyboard shortcuts

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