Ejemplo n.º 1
0
        /**
         * Gets the data portion of the record
         *
         * @return the data portion of the record
         */
        public byte[] getData()
        {
            if (data == null)
            {
                data = file.read(dataPos, length);
            }

            // copy in any data from the continue records
            if (continueRecords != null)
            {
                int      size     = 0;
                byte[][] contData = new byte[continueRecords.Count][];
                for (int i = 0; i < continueRecords.Count; i++)
                {
                    Record r = (Record)continueRecords[i];
                    contData[i] = r.getData();
                    byte[] d2 = contData[i];
                    size += d2.Length;
                }

                byte[] d3 = new byte[data.Length + size];
                System.Array.Copy(data, 0, d3, 0, data.Length);
                int pos = data.Length;
                for (int i = 0; i < contData.Length; i++)
                {
                    byte[] d2 = contData[i];
                    System.Array.Copy(d2, 0, d3, pos, d2.Length);
                    pos += d2.Length;
                }

                data = d3;
            }

            return(data);
        }