20
0
xls/bof.go
2021-03-30 13:28:12 +03:00

27 lines
450 B
Go

package xls
import (
"encoding/binary"
"io"
"unicode/utf16"
)
//the information unit in xls file
type bof struct {
Id uint16
Size uint16
}
//read the utf16 string from reader
func (b *bof) utf16String(buf io.ReadSeeker, count uint32) string {
var bts = make([]uint16, count)
binary.Read(buf, binary.LittleEndian, &bts)
runes := utf16.Decode(bts[:len(bts)-1])
return string(runes)
}
type biffHeader struct {
Ver uint16
Type uint16
}