mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-07-15 17:55:30 +08:00
Revert "test NSFile::CFileBinary as Stream"
This reverts commit 54261fd1a1.
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user