ReadBuffer() private méthode

Same than ReadMemory(), but returns a byte[] array.
private ReadBuffer ( TargetMemoryAccess target, int size ) : byte[]
target TargetMemoryAccess
size int
Résultat byte[]
        internal override TargetBlob ReadMemory(TargetMemoryAccess target, int size)
        {
            byte[] data = relative_to.ReadBuffer(target, size);

            int total_size = 8 * data.Length;

            bool[] bit_data    = new bool [total_size];
            bool[] target_bits = new bool [total_size];

            // FIXME
            bool is_bigendian = false;

            int bit_pos = 0;

            for (int i = 0; i < data.Length; i++)
            {
                byte current = data [i];
                for (int j = 0; j < 8; j++)
                {
                    bit_data [bit_pos++] = (current & (1 << j)) != 0;
                }
            }

            bit_pos = 0;
            if (!is_bigendian)
            {
                bit_offset = total_size - bit_offset - bit_size;
            }

            for (int i = bit_offset; i < bit_offset + bit_size; i++)
            {
                target_bits [bit_pos++] = bit_data [i];
            }

            byte[] blob = new byte [data.Length];
            bit_pos = 0;
            for (int i = 0; i < blob.Length; i++)
            {
                int current = 0;
                for (int j = 0; j < 8; j++)
                {
                    if (target_bits [bit_pos++])
                    {
                        current |= 1 << j;
                    }
                }
                blob [i] = (byte)current;
            }

            return(new TargetBlob(blob, target.TargetMemoryInfo));
        }