A better SDK with more features and more consistency

This commit is contained in:
2026-09-15 13:19:48 +01:00
parent 047deb65e7
commit a7fbf74f0a
10 changed files with 583 additions and 65 deletions
+30
View File
@@ -0,0 +1,30 @@
package bngsdk
import (
"encoding/binary"
"os"
)
type OgBinWriter struct {
file *os.File
}
func NewOgBinWriter(path string) (*OgBinWriter, error) {
outputFile, err := os.Create(path)
if err != nil {
return nil, err
}
return &OgBinWriter{
file: outputFile,
}, nil
}
func (ogw *OgBinWriter) Write(data []byte) (int, error) {
err := binary.Write(ogw.file, binary.LittleEndian, data)
if err != nil {
return 0, err
}
return len(data), nil
}