IByteProvider

IBytePprovider is used internally by HexView control to get bytes from the array of fixed size

    public interface IByteProvider
    {
        byte GetByte(int offset);
        int Length { get; }
    }

ByteProvider

Reference implementation:

        class ByteProvider : IByteProvider
        {
            private byte[] bytes;

            public ByteProvider(byte[] bytes)
            {
                this.bytes = bytes;
            }

            public byte GetByte(int offset)
            {
                return bytes[offset];
            }

            public int Length
            {
                get { return bytes.Length; }
            }
        }

Last edited May 1, 2012 at 1:48 AM by hack2root, version 9

Comments

No comments yet.