Adding test for encrypted cloud storage; Adding preparation timing test for Fidelius...
[iotcloud.git] / version2 / src / C / ByteBuffer.h
index ec98caf151c2a12649178e12557dc7ea35cde966..06c309bf885a088ff0521f4da6754f0e4f36b86d 100644 (file)
@@ -5,8 +5,25 @@
 class ByteBuffer {
 public:
        void put(char c);
+       void putInt(int32_t l);
        void putLong(int64_t l);
+       void put(Array<char> *array);
        int64_t getLong();
-private:
+       int32_t getInt();
+       char get();
+       void get(Array<char> *array);
+       void position(int32_t newPosition);
+       void releaseArray() {buffer = NULL;}
+       Array<char> *array();
+       ~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);
 #endif