ssize_t FKCW_IO_AssetInputStream_android::Read(char* buffer, size_t length)
{
	int canRead = MIN(length, GetAvailableLength());
	memcpy(buffer, m_buffer + m_position, canRead);
	m_position += canRead;
	return canRead;
}
Esempio n. 2
0
std::vector<unsigned char> InMemoryStream::GetBytes(unsigned int count) {
  ARC_ASSERT(count <= GetAvailableLength());
  std::vector<unsigned char> result;
  result.resize(count);

  auto currentPos = m_data + m_bytesRead;
  std::copy(currentPos, currentPos + count, result.begin());
  m_bytesRead += count;

  return result;
}
Esempio n. 3
0
void InMemoryStream::EnsureBytesAvailable(unsigned int count /* = 0 */) {
  ARC_ASSERT(count <= GetAvailableLength());
  UNREFERENCED_PARAMETER(count);  // needed for release builds
  // nothing to do here other than assert, There is no data source to pull extra bytes from
}
Esempio n. 4
0
void InMemoryStream::Advance(unsigned int count) {
  ARC_ASSERT(count <= GetAvailableLength());
  m_bytesRead += count;
}