Call the EncodeBlock method in a loop to let the stream encode data.
The EncodeBlock 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.