persist/include/persist/core/storage/file_storage.hpp
/**
 * Read file content starting at given postion into a ByteBuffer. The amount of
 * data read is determined by the size of the passed ByteBuffer.
 *
 * Note:
 * - If the size of the ByteBuffer is zero then no data will be read.
 * - The content of the ByteBuffer will be overwritten
 *
 * @param file opened file stream object
 * @param buffer reference to the ByteBuffer where read data is stored
 * @param offset offset within the file from where to start reading
 */
Read file content starting at given postion into a ByteBuffer. The amount of
data read is determined by the size of the passed ByteBuffer.

- If the size of the ByteBuffer is zero then no data will be read.
- The content of the ByteBuffer will be overwritten

@param file opened file stream object
@param buffer reference to the ByteBuffer where read data is stored
@param offset offset within the file from where to start reading
Read file content starting at given postion into a ByteBuffer . The amount of data read is determined by the size of the passed ByteBuffer . - If the size of the ByteBuffer is zero then no data will be read . - The content of the ByteBuffer will be overwritten @param file opened file stream object @param buffer reference to the ByteBuffer where read data is stored @param offset offset within the file from where to start reading
static void read(std::fstream &file, ByteBuffer &buffer,
                 std::streampos offset) {
  std::streampos original = file.tellg();
  file.seekg(offset);
  file.read(reinterpret_cast<char *>(&buffer[0]), buffer.size());
  file.seekg(original);
}
static void read ( std :: fstream & file , ByteBuffer & buffer , std :: streampos offset ) { std :: streampos original = file . tellg ( ) ; file . seekg ( offset ) ; file . read ( reinterpret_cast < char * > ( & buffer [ 0 ] ) , buffer . size ( ) ) ; file . seekg ( original ) ; }
Read file content starting at given postion into a ByteBuffer.
Read file content starting at given postion into a ByteBuffer .
// Get current position of the stream cursor before moving // Place the moved cursor back to its original postion