void write(const std::vector<ByteBuffer> &byteBuffers) { std::copy( byteBuffers.begin(), byteBuffers.end(), std::back_inserter(mByteBuffers)); std::size_t bytesTransferred = lengthByteBuffers(byteBuffers); getPreFilter().onWriteCompleted(bytesTransferred); }
void XorFilter::onReadCompleted(const ByteBuffer &byteBuffer, int error) { RCF_UNUSED_VARIABLE(error); // TODO: error handling for (std::size_t i=0; i<byteBuffer.getLength() ; ++i) { byteBuffer.getPtr() [i] ^= mMask; } getPreFilter().onReadCompleted(byteBuffer, 0); }
void read(const ByteBuffer &byteBuffer, std::size_t bytesRequested) { RCF_ASSERT(byteBuffer.isEmpty())(byteBuffer.getLength()); RCF_ASSERT_LT(mInByteBufferPos, mInByteBuffer.getLength()); std::size_t bytesRemaining = mInByteBuffer.getLength() - mInByteBufferPos; std::size_t bytesToRead = RCF_MIN(bytesRemaining, bytesRequested); ByteBuffer myByteBuffer(mInByteBuffer, mInByteBufferPos, bytesToRead); mInByteBufferPos += bytesToRead; getPreFilter().onReadCompleted(myByteBuffer); }
void IdentityFilter::onWriteCompleted(std::size_t bytesTransferred) { getPreFilter().onWriteCompleted(bytesTransferred); }
void IdentityFilter::onReadCompleted(const ByteBuffer &byteBuffer) { getPreFilter().onReadCompleted(byteBuffer); }
void XorFilter::onWriteCompleted(std::size_t bytesTransferred, int error) { RCF_UNUSED_VARIABLE(error); // TODO: error handling getPreFilter().onWriteCompleted(bytesTransferred, 0); }