Adding test for encrypted cloud storage; Adding preparation timing test for Fidelius...
[iotcloud.git] / version2 / src / C / ByteBuffer.h
index 89156066d19b33445a48e7e1c6ca61e4f0cdd0bd..06c309bf885a088ff0521f4da6754f0e4f36b86d 100644 (file)
@@ -13,8 +13,16 @@ public:
        char get();
        void get(Array<char> *array);
        void position(int32_t newPosition);
+       void releaseArray() {buffer = NULL;}
        Array<char> *array();
-private:
+       ~ByteBuffer() {if (buffer != NULL) delete buffer;}
+       
+ private:
+       ByteBuffer(Array<char> *array);
+       friend ByteBuffer *ByteBuffer_wrap(Array<char> *array);
+       friend ByteBuffer *ByteBuffer_allocate(uint size);
+       Array<char> *buffer;
+       uint offset;
 };
 ByteBuffer *ByteBuffer_wrap(Array<char> *array);
 ByteBuffer *ByteBuffer_allocate(uint size);