Implement commit

The commit operation will serialize the binarystore protobuf and write
it to the designated sysfile location, with its size stored followed by
actual data.

Signed-off-by: Kun Yi <kunyi@google.com>
Change-Id: Idc16f410d3a1585daaddda58a3665d92a898f5c7
diff --git a/binarystore_mock.hpp b/binarystore_mock.hpp
index bf8c811..3c7e6c8 100644
--- a/binarystore_mock.hpp
+++ b/binarystore_mock.hpp
@@ -31,6 +31,8 @@
             .WillByDefault(Invoke(&real_store_, &BinaryStore::read));
         ON_CALL(*this, write)
             .WillByDefault(Invoke(&real_store_, &BinaryStore::write));
+        ON_CALL(*this, commit)
+            .WillByDefault(Invoke(&real_store_, &BinaryStore::commit));
     }
     MOCK_CONST_METHOD0(getBaseBlobId, std::string());
     MOCK_CONST_METHOD0(getBlobIds, std::vector<std::string>());