public void ReadBytes(int length, IntrusiveByteArrayWriter writer)
        {
            if (length > 0)
            {
                writer.EnsureCapacity(length);

                var bytesRead = stream.Read(writer.Buffer, writer.Length, length);
                if (bytesRead == -1) throw new IOException("Could not read bytes from the stream");

                while (bytesRead < length)
                {
                    var t = stream.Read(writer.Buffer, writer.Length + bytesRead, length - bytesRead);
                    if (bytesRead == -1) throw new IOException("Could not read bytes from the stream");
                    bytesRead += t;
                }

                // TODO: *puke*
                writer.Length += bytesRead;
            }
        }