isbinary

package module
v0.0.0-...-2da2e88 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2019 License: Apache-2.0 Imports: 1 Imported by: 6

README

isbinary

GoDoc

This package exposes helper functions that allow checking whether some input is binary or textual data. For more information, please see the GoDoc.

Documentation

Index

Constants

View Source
const BlockSize = 512

BlockSize is the amount of data that will be considered when testing for binary data.

Variables

This section is empty.

Functions

func Test

func Test(buf []byte) bool

Test will return whether or not the data contained in the first BlockSize bytes of the input buffer is binary data. It will attempt to properly handle UTF-8 encoded data - see the source for more information.

func TestReader

func TestReader(r io.Reader) (bool, error)

TestReader performs the same checks as Test, but will read the data to test from the provided io.Reader.

Types

This section is empty.

Jump to

Keyboard shortcuts

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