mmap

package
v0.0.0-...-27647ab Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: BSD-3-Clause Imports: 6 Imported by: 1

Documentation

Overview

Package mmap provides a way to memory-map a file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OpenReaderAt

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

OpenReaderAt reads a memory-mapped file.

Like any io.ReaderAt, clients can execute parallel ReadAt calls, but it is not safe to call Close and reading methods concurrently.

func Open

func Open(filename string) (*OpenReaderAt, error)

Open memory-maps the named file for reading.

func (*OpenReaderAt) At

func (r *OpenReaderAt) At(i int) byte

At returns the byte at index i.

func (*OpenReaderAt) Bytes

func (r *OpenReaderAt) Bytes() []byte

func (*OpenReaderAt) Close

func (r *OpenReaderAt) Close() error

Close closes the reader.

func (*OpenReaderAt) Len

func (r *OpenReaderAt) Len() int

Len returns the length of the underlying memory-mapped file.

func (*OpenReaderAt) ReadAt

func (r *OpenReaderAt) ReadAt(p []byte, off int64) (int, error)

ReadAt implements the io.ReaderAt interface.

Jump to

Keyboard shortcuts

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