summaryrefslogtreecommitdiffstats
path: root/rsStream.h
diff options
context:
space:
mode:
Diffstat (limited to 'rsStream.h')
-rw-r--r--rsStream.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/rsStream.h b/rsStream.h
index 5ccd6ca5..d401cd12 100644
--- a/rsStream.h
+++ b/rsStream.h
@@ -86,6 +86,13 @@ public:
OStream(uint64_t length, bool use64);
~OStream();
+ void align(uint32_t bytes) {
+ mPos = (mPos + (bytes - 1)) & (~(bytes - 1));
+ if(mPos >= mLength) {
+ growSize();
+ }
+ }
+
void addF(float v) {
uint32_t uintV = *reinterpret_cast<uint32_t*> (&v);
addU32(uintV);