Documentation ¶
Index ¶
- Constants
- func BytesToInt(gBytes []byte) uint32
- func BytesToIntSynchsafe(gBytes []byte) uint32
- func DecodeText(fContents []byte) string
- func GetBit(b byte, bitN int) bool
- func GetKey(mp map[int]string, givenValue string) int
- func InASCII(chars string) bool
- func IntToBytes(gInt uint32) []byte
- func IntToBytesSynchsafe(gInt uint32) []byte
- func Read(r io.Reader, n uint64) ([]byte, error)
- func ReadToString(r io.Reader, n uint64) (string, error)
- func SetBit(b byte, bitN int) byte
- func ToStringLossy(gBytes []byte) string
- func WriteToExtent(wr io.Writer, data []byte, lenNeeded int) error
Constants ¶
const ( EncodingISO8859 byte = iota EncodingUTF16BOM EncodingUTF16 EncodingUTF8 )
Variables ¶
This section is empty.
Functions ¶
func BytesToIntSynchsafe ¶
Decodes given integer bytes into integer, ignores the first bit of every given byte in binary form
func GetKey ¶
Returns found key (int) in provided map by value (string); If key does not exist in map - returns -1
func IntToBytes ¶
Simply converts given uint32 into synch unsafe bytes
func IntToBytesSynchsafe ¶
The exact opposite of what `BytesToIntSynchsafe` does Finally understood with the help of: https://github.com/bogem/id3v2/blob/master/size.go , thank you very much !
func Read ¶
Shortcut function to read n bytes from reader. The general idea peeked from here: https://github.com/dhowden/tag/blob/master/util.go
func ReadToString ¶
Reads from rs and conversts read []byte into string, ignoring all non-printable or invalid characters.
func SetBit ¶
Sets bit to 1 in provided byte, if bitN <= 0 returns original b without modifications. bitN is the position of the bit FROM THE LAST RIGHT one! ie: byte := 0 // 00000000 newbyte := SetBit(byte, 1) // 1 // 00000001
func ToStringLossy ¶
Converts given bytes into string, ignoring the first 31 non-printable ASCII characters. (LOSSY, if given bytes contain some nasty ones)
Types ¶
This section is empty.