Help us shape the future of Go! Take the 2026 Go Developer Survey

bitstreamops

package module
v0.0.0-...-17e38e7 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2017 License: Apache-2.0 Imports: 3 Imported by: 2

README

Go Bitstream Ops

GoDoc

Provides some basic wrapper interfaces around byte arrays to operate on them as bitstreams.

Contact: developer@tenta.io

Installation

  1. go get github.com/tenta-browser/go-bitstream-ops

License

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

For any questions, please contact developer@tenta.io

Contributing

We welcome contributions, feedback and plain old complaining. Feel free to open an issue or shoot us a message to developer@tenta.io. If you'd like to contribute, please open a pull request and send us an email to sign a contributor agreement.

About Tenta

This bitstream library is brought to you by Team Tenta. Tenta is your private, encrypted browser that protects your data instead of selling. We're building a next-generation browser that combines all the privacy tools you need, including built-in OpenVPN. Everything is encrypted by default. That means your bookmarks, saved tabs, web history, web traffic, downloaded files, IP address and DNS. A truly incognito browser that's fast and easy.

Documentation

Overview

Provides some basic wrapper interfaces around byte arrays to operate on them as bitstreams.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BitStreamOps

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

func NewBitStreamOps

func NewBitStreamOps() *BitStreamOps

func NewBitStreamOpsReader

func NewBitStreamOpsReader(b []byte) *BitStreamOps

func (*BitStreamOps) Append

func (b *BitStreamOps) Append(s []byte)

/ Append and Concat assumes byte boundaries are all settled and in order

func (*BitStreamOps) BIndex

func (b *BitStreamOps) BIndex() uint

func (*BitStreamOps) Buffer

func (b *BitStreamOps) Buffer() []byte

func (*BitStreamOps) Collect

func (b *BitStreamOps) Collect(numbits int) (ret uint, err error)

func (*BitStreamOps) CollectAll

func (b *BitStreamOps) CollectAll() []byte

func (*BitStreamOps) CollectByte

func (b *BitStreamOps) CollectByte() (ret uint, err error)

** Jump to next byte boundary before calling Collect on data more than 1 bit

func (*BitStreamOps) CollectDWord

func (b *BitStreamOps) CollectDWord() (ret uint, err error)

func (*BitStreamOps) CollectWord

func (b *BitStreamOps) CollectWord() (ret uint, err error)

func (*BitStreamOps) Concat

func (b *BitStreamOps) Concat(s string)

func (*BitStreamOps) DeAppend

func (b *BitStreamOps) DeAppend(n int) ([]byte, error)

func (*BitStreamOps) DeConcat

func (b *BitStreamOps) DeConcat(n int) (string, error)

func (*BitStreamOps) Emit

func (b *BitStreamOps) Emit(val uint, numbits int) (err error)

func (*BitStreamOps) EmitByte

func (b *BitStreamOps) EmitByte(val uint8)

** Call JumpToNextByte before calling emit on data more than 1 bit

func (*BitStreamOps) EmitDWord

func (b *BitStreamOps) EmitDWord(val uint32)

func (*BitStreamOps) EmitWord

func (b *BitStreamOps) EmitWord(val uint16)

func (*BitStreamOps) HasMoreBytes

func (b *BitStreamOps) HasMoreBytes() bool

func (*BitStreamOps) Index

func (b *BitStreamOps) Index() uint

func (*BitStreamOps) JumpToNextByte

func (b *BitStreamOps) JumpToNextByte()

** Does not check end of buffer (so that it can be used for r/w)

func (*BitStreamOps) JumpToNextByteForRead

func (b *BitStreamOps) JumpToNextByteForRead()

func (*BitStreamOps) WriteToFile

func (b *BitStreamOps) WriteToFile(fname string) (err error)

Jump to

Keyboard shortcuts

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