netascii

package
v0.0.0-...-766a6dd Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package netascii implements reading and writing of netascii, as defined in RFC 764.

Netascii encodes LF to CRLF and CR to CRNUL. CRLF is decoded to the platform's representation of a new line.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

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

Reader is an io.Reader used to retrieve data in the local system's format from a netascii encoded source.

func NewReader

func NewReader(reader io.Reader) *Reader

NewReader returns a Reader wrapping r.

func (*Reader) Read

func (d *Reader) Read(p []byte) (int, error)

Read reads and decodes netascii from r.

type Writer

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

Writer is an io.Writer. Writes to Writer are encoded into netascii and written to w.

func NewWriter

func NewWriter(w io.Writer) *Writer

NewWriter returns a Writer wrapping the w.

func (*Writer) Flush

func (e *Writer) Flush() error

Flush flushes any pending data to w.

func (*Writer) Write

func (e *Writer) Write(p []byte) (int, error)

Write encodes p as netascii and writes it to w. Writer must be flushed to guarantee that all data has been written to w.

Jump to

Keyboard shortcuts

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