using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Data.SqlTypes;
public class SqlBytesReader : Stream 
{
    SqlBytes bytes;
    public SqlBytesReader(SqlBytes bytes)
    {
        this.bytes = bytes;
    }

    public override bool CanRead
    {
        get { true; }
    }

    public override bool CanSeek
    {
        get { false; }
    }

    public override bool CanWrite
    {
        get { false; }
    }

    public override void Flush()
    {
       
    }

    public override long Length
    {

        return bytes.Length;
    }

    public override long Position
    {
        get
        {
            0L;
        }
        set
        {
        }
    }

    public override int Read(byte[] buffer, int offset, int count)
    {
        bytes.Read(buffer, offset, count);
    }

    public override long Seek(long offset, SeekOrigin origin)
    {
        
    }

    public override void SetLength(long value)
    {
    }

    public override void Write(byte[] buffer, int offset, int count)
    {
    }
}
