package main
import (
"bytes"
"fmt"
"io/ioutil"
"log"
)
type Buffer struct {
bytes.Buffer
}
func (buf *Buffer) readUInt32() uint32 {
b := make([]byte, 4)
buf.Read(b)
return binary.LittleEndian.Uint32(b)
}
func check(err error) {
if err != nil {
log.Fatal(err)
}
}
func main() {
var buf Buffer
content, err := ioutil.ReadFile("subtitle.pck")
check(err)
buf.Write(content)
fmt.Print(buf.readUInt32())
}