public virtual void CopyBytes(DataInput input, long numBytes)
{
Debug.Assert(numBytes >= 0, "numBytes=" + numBytes);
long left = numBytes;
if (CopyBuffer == null)
{
CopyBuffer = new byte[COPY_BUFFER_SIZE];
}
while (left > 0)
{
int toCopy;
if (left > COPY_BUFFER_SIZE)
{
toCopy = COPY_BUFFER_SIZE;
}
else
{
toCopy = (int)left;
}
input.ReadBytes(CopyBuffer, 0, toCopy);
WriteBytes(CopyBuffer, 0, toCopy);
left -= toCopy;
}
}