PIIODevice::bytesAvailible()

fix pistringlist pibinarystream write
pibinarystream::binaryStreamSize()
PIByteArray pibinarystream read with more size fix
pistring pibinarystream read optimization
fix bug in PIIOBinaryStream read and write if failed
workaround in PIIOString::readDevice
PISPI readDevice bug Fixed
This commit is contained in:
Бычков Андрей
2022-07-27 15:43:04 +03:00
parent d13e68c206
commit 3873f0b03b
50 changed files with 323 additions and 253 deletions

View File

@@ -49,6 +49,15 @@ PITransparentDevice::~PITransparentDevice() {
}
ssize_t PITransparentDevice::bytesAvailible() const {
ssize_t ret = 0;
que_mutex.lock();
if (que.isNotEmpty()) ret = que.back().size();
que_mutex.unlock();
return ret;
}
int PITransparentDevice::readDevice(void * read_to, int max_size) {
if (!canRead()) return -1;
que_mutex.lock();