why not use:
<code>
long read = 0;
while ((read = this.GetBytes (i, offset, buffer, 0, buffer.Length)) > 0)
{
memoryStream.Write (buffer, 0, (int) read);
offset += read;
}
</code>