Documentation ¶
Overview ¶
Copyright 2013 Michael Yang. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.
Copyright 2013 Michael Yang. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.
Copyright 2013 Michael Yang. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.
Index ¶
- Constants
- Variables
- func ByteInt(buf []byte, base uint) (i uint32, err error)
- func EncodedDiff(newEncoding byte, newString string, oldEncoding byte, oldString string) (int, error)
- func EncodingForIndex(b byte) string
- func EncodingNullLengthForIndex(b byte) int
- func IndexForEncoding(e string) byte
- func IntBytes(n uint32, base uint) []byte
- func NormBytes(n uint32) []byte
- func NormInt(buf []byte) (i uint32, err error)
- func SynchBytes(n uint32) []byte
- func SynchInt(buf []byte) (i uint32, err error)
- type Encoding
- type Reader
- func (r *Reader) Read(b []byte) (n int, err error)
- func (r *Reader) ReadByte() (b byte, err error)
- func (r *Reader) ReadNullTermString(encoding byte) (string, error)
- func (r *Reader) ReadNumBytes(n int) ([]byte, error)
- func (r *Reader) ReadNumBytesString(n int) (string, error)
- func (r *Reader) ReadRest() ([]byte, error)
- func (r *Reader) ReadRestString(encoding byte) (string, error)
- type Writer
Constants ¶
View Source
const ( BytesPerInt = 4 SynchByteLength = 7 NormByteLength = 8 NativeEncoding = 3 )
Variables ¶
View Source
var ( EncodingMap = [...]Encoding{ {Name: "ISO-8859-1", NullLength: 1}, {Name: "UTF-16", NullLength: 2}, {Name: "UTF-16BE", NullLength: 2}, {Name: "UTF-8", NullLength: 1}, } Decoders = make([]*iconv.Converter, len(EncodingMap)) Encoders = make([]*iconv.Converter, len(EncodingMap)) )
Functions ¶
func EncodedDiff ¶
func EncodingForIndex ¶
func IndexForEncoding ¶
func SynchBytes ¶
Types ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader is a helper for Reading frame bytes
func (*Reader) ReadNullTermString ¶
Read a null terminated string of specified encoding
func (*Reader) ReadNumBytesString ¶
Read a number of bytes and cast to a string
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer is a helper for writing frame bytes
func (*Writer) WriteNullTermString ¶
Click to show internal directories.
Click to hide internal directories.