Jake Smith 13 anni fa
parent
commit
a38ec74791
1 ha cambiato i file con 5 aggiunte e 1 eliminazioni
  1. 5 1
      system/jlib/jbuff.hpp

+ 5 - 1
system/jlib/jbuff.hpp

@@ -224,9 +224,13 @@ public:
     }
     inline void write()
     {
-        size32_t sz = mb.length() - (pos + sizeof(size32_t));
+        size32_t sz = size();
         mb.writeDirect(pos, sizeof(sz), &sz);
     }
+    inline size32_t size() const
+    {
+        return mb.length() - (pos + sizeof(size32_t));
+    }
     // resets position marker and writes another size to be filled subsequently by write()
     inline void restart()
     {