Revert "test NSFile::CFileBinary as Stream"

This reverts commit 54261fd1a1.
This commit is contained in:
Ivan Morozov
2022-08-01 19:41:46 +03:00
parent 54261fd1a1
commit 8f74b9362a
17 changed files with 179 additions and 184 deletions

View File

@ -5,12 +5,32 @@ using namespace CFCPP;
StreamRW::StreamRW(const Stream &stream)
: stream(stream)
{}
{
buffer.fill(0);
}
T_LONG64 StreamRW::Seek(T_LONG64 offset)
{
if(!stream->SeekFile(offset, SEEK_SET))
return -1;
return stream->TellFile();
stream->seekp(offset, std::ios::beg);
return stream->tellp();
}
void StreamRW::ReadArray(char *data, int lenght)
{
stream->read(data, lenght);
}
void StreamRW::ReadArray(BYTE* data, int lenght)
{
stream->read(reinterpret_cast<char*>(data), lenght);
}
void StreamRW::WriteArray(const BYTE *arr, int lenght)
{
stream->write(reinterpret_cast<const char*>(arr), lenght);
}
void StreamRW::WriteArray(const char *arr, int lenght)
{
stream->write(arr, lenght);
}