void WriteStep(int fd, int step) { // We want to store three parts in every time step. This is done by a set of parts covWriteSetBegin(fd, 3); /* the three parts */ WritePart(fd, step, 1); WritePart(fd, step, 2); WritePart(fd, step, 3); // You MUST add attributes to every COVISE object although you don't really have one! covWriteSetEnd(fd, NULL, NULL, COUNT_ATTR); }
void OutFile::Write(const BYTE *pbyBuffer, UINT32 nBytesToWrite) const { UINT32 unBytesProcessed = 0; while (unBytesProcessed < nBytesToWrite) { auto unBytesWrite = WritePart(pbyBuffer, nBytesToWrite); if (!unBytesWrite) { return; } pbyBuffer += unBytesWrite; unBytesProcessed += unBytesWrite; } }
void stereoprot_sendArray(struct link_device *fd, uint8_t *b, uint8_t array_width, uint8_t array_height) { uint8_t code[4]; code[0] = 0xff; code[1] = 0x00; code[2] = 0x00; code[3] = 0xAF; // 175 WritePart(fd, code, 4); int horizontalLine = 0; for (horizontalLine = 0; horizontalLine < array_height; horizontalLine++) { code[3] = 0x80;//128 WritePart(fd, code, 4); WritePart(fd, b + array_width * horizontalLine, array_width); code[3] = 0xDA;//218 WritePart(fd, code, 4); } code[3] = 0xAB; WritePart(fd, code, 4); }
bool CFile::Write(const void *data, UInt32 size, UInt32 &processedSize) { processedSize = 0; do { UInt32 processedLoc = 0; bool res = WritePart(data, size, processedLoc); processedSize += processedLoc; if (!res) return false; if (processedLoc == 0) return true; data = (const void*)((const unsigned char*)data + processedLoc); size -= processedLoc; } while (size > 0); return true; }
HRESULT CLZMA::Write(const void *data, UINT32 size, UINT32 *processedSize) { return WritePart(data, size, processedSize); }