View Source Unzip.FileAccess protocol (unzip v0.7.1)

Should be implemented for the module which can read from the file system.

Link to this section Summary

Functions

Reads the chunk of data from the file.

Returns the size of the file in bytes.

Link to this section Types

@type chunk() :: binary()
@type reason() :: term()
@type t() :: FileAccess.t()

Link to this section Functions

Link to this function

pread(file, offset, length)

View Source
@spec pread(t(), pos_integer(), pos_integer()) :: {:ok, chunk()} | {:error, reason()}

Reads the chunk of data from the file.

It should return {:ok, binary} where binary is the chunk found at offset with length length

@spec size(t()) :: {:ok, pos_integer()} | {:error, reason()}

Returns the size of the file in bytes.