void FileAnsii::Read(Bwx& aBuffer, TUint32 aBytes) { // IFile implementations must check read length ASSERT(aBytes); // Check there's enough space in read buffer ASSERT(aBytes <= aBuffer.BytesRemaining()); // Find read pointer TByte* p = const_cast<TByte*>(aBuffer.Ptr()) + aBuffer.Bytes(); // Do the read TUint bytesRead = (TUint)fread(p, 1, aBytes, iFilePtr); // Register the new content with the buffer aBuffer.SetBytes(aBuffer.Bytes() + bytesRead); // throw if entire read wasn't performed if ( bytesRead == 0 ) THROW(FileReadError); }
void FileAnsii::Read(Bwx& aBuffer) { Read(aBuffer, aBuffer.BytesRemaining()); }