/**
         * Makes sure the record stream starts with {@link BOFRecord} and then {@link WindowOneRecord}
         * The second record is Gets decrypted so this method also Checks its content.
         */
        private void ConfirmReadInitialRecords(RecordFactoryInputStream rfis)
        {
            Assert.AreEqual(typeof(BOFRecord), rfis.NextRecord().GetType());
            WindowOneRecord rec1 = (WindowOneRecord)rfis.NextRecord();

            Assert.IsTrue(Arrays.Equals(HexRead.ReadFromString(SAMPLE_WINDOW1), rec1.Serialize()));
        }
Example #2
0
        /**
         * Create an array of records from an input stream
         *
         * @param in the InputStream from which the records will be
         *           obtained
         *
         * @return an array of Records Created from the InputStream
         *
         * @exception RecordFormatException on error Processing the
         *            InputStream
         */

        public static List<Record> CreateRecords(Stream in1)
        {
            List<Record> records = new List<Record>(NUM_RECORDS);


            RecordFactoryInputStream recStream = new RecordFactoryInputStream(in1, true);

            Record record;
            while ((record = recStream.NextRecord()) != null)
            {
                records.Add(record);
            }

            return records;
        }