Example #1
0
 /// <summary>
 /// Decodes the escher stream from a byte array and dumps the results to
 /// a print stream.
 /// </summary>
 /// <param name="data">The data array containing the escher records.</param>
 /// <param name="offset">The starting offset within the data array.</param>
 /// <param name="size">The number of bytes to Read.</param>
 public void Dump(byte[] data, int offset, int size)
 {
     EscherRecordFactory recordFactory = new DefaultEscherRecordFactory();
     int pos = offset;
     while (pos < offset + size)
     {
         EscherRecord r = recordFactory.CreateRecord(data, pos);
         int bytesRead = r.FillFields(data, pos, recordFactory);
         Console.WriteLine(r.ToString());
         pos += bytesRead;
     }
 }
Example #2
0
        /// <summary>
        /// Decodes the escher stream from a byte array and dumps the results to
        /// a print stream.
        /// </summary>
        /// <param name="data">The data array containing the escher records.</param>
        /// <param name="offset">The starting offset within the data array.</param>
        /// <param name="size">The number of bytes to Read.</param>
        public void Dump(byte[] data, int offset, int size)
        {
            EscherRecordFactory recordFactory = new DefaultEscherRecordFactory();
            int pos = offset;

            while (pos < offset + size)
            {
                EscherRecord r         = recordFactory.CreateRecord(data, pos);
                int          bytesRead = r.FillFields(data, pos, recordFactory);
                Console.WriteLine(r.ToString());
                pos += bytesRead;
            }
        }
 private void ConvertToEscherRecords(int offset, int size, byte[] data)
 {
     escherRecords.Clear();
     EscherRecordFactory recordFactory = new DefaultEscherRecordFactory();
     int pos = offset;
     while (pos < offset + size)
     {
         EscherRecord r = recordFactory.CreateRecord(data, pos);
         int bytesRead = r.FillFields(data, pos, recordFactory);
         escherRecords.Add(r);
         pos += bytesRead;
     }
 }