Call the ReadBlock method in a loop to let the stream encode data.
The ReadBlock function returns the count of bytes that were put in the shared MemoryBlock buffer.
The EncodeBlock method does the same as the ReadBlock function. The ReadBlock method is provided for compliance with the IBlockReader interface.