mmap

package
v0.0.0-...-57c1bf3 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2019 License: BSD-3-Clause Imports: 6 Imported by: 0

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 ReaderAt

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

ReaderAt 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) (*ReaderAt, error)

Open memory-maps the named file for reading.

func (*ReaderAt) At

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

At returns the byte at index i.

func (*ReaderAt) Close

func (r *ReaderAt) Close() error

Close closes the reader.

func (*ReaderAt) Len

func (r *ReaderAt) Len() int

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

func (*ReaderAt) ReadAt

func (r *ReaderAt) 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