mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-11-17 18:06:03 -05:00
d2common/d2datautils/StreamWriter: add Align method
This commit is contained in:
parent
8d982b4611
commit
1224a38796
@ -136,3 +136,10 @@ func (v *StreamWriter) PushUint64(val uint64) {
|
||||
v.data.WriteByte(byte(val >> 48))
|
||||
v.data.WriteByte(byte(val >> 56))
|
||||
}
|
||||
|
||||
// Align aligns stream writer to bytes
|
||||
func (v *StreamWriter) Align() {
|
||||
if o := v.bitOffset % bitsPerByte; o > 0 {
|
||||
v.PushBits(0, bitsPerByte-o)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user