예제 #1
0
 public void ReadFully(byte[] buf, int off, int len)
 {
     CheckRecordPosition(len);
     _dataInput.ReadFully(buf, off, len);
     _currentDataOffset += len;
     pos += len;
 }
예제 #2
0
 public UnknownSubRecord(LittleEndianInput in1, int sid, int size)
 {
     _sid = sid;
     byte[] buf = new byte[size];
     in1.ReadFully(buf);
     _data = buf;
 }
 /**
  * Constructs a NoteStructureSubRecord and Sets its fields appropriately.
  *
  */
 public NoteStructureSubRecord(LittleEndianInput in1, int size)
 {
     if (size != ENCODED_SIZE) {
         throw new RecordFormatException("Unexpected size (" + size + ")");
     }
     //just grab the raw data
     byte[] buf = new byte[size];
     in1.ReadFully(buf);
     reserved = buf;
 }
예제 #4
0
 /**
  * Constructs a NoteStructureSubRecord and Sets its fields appropriately.
  *
  */
 public NoteStructureSubRecord(LittleEndianInput in1, int size)
 {
     if (size != ENCODED_SIZE)
     {
         throw new RecordFormatException("Unexpected size (" + size + ")");
     }
     //just grab the raw data
     byte[] buf = new byte[size];
     in1.ReadFully(buf);
     reserved = buf;
 }
예제 #5
0
 private static byte[] ReadRawData(LittleEndianInput in1, int size)
 {
     if (size < 0)
     {
         throw new ArgumentException("Negative size (" + size + ")");
     }
     if (size == 0)
     {
         return(EMPTY_BYTE_ARRAY);
     }
     byte[] result = new byte[size];
     in1.ReadFully(result);
     return(result);
 }
예제 #6
0
 private static byte[] ReadTail(byte[] expectedTail, LittleEndianInput in1)
 {
     byte[] result = new byte[TAIL_SIZE];
     in1.ReadFully(result);
     //if (false)
     //{ // Quite a few examples in the unit tests which don't have the exact expected tail
     //    for (int i = 0; i < expectedTail.Length; i++)
     //    {
     //        if (expectedTail[i] != result[i])
     //        {
     //            Console.WriteLine("Mismatch in tail byte [" + i + "]"
     //                    + "expected " + (expectedTail[i] & 0xFF) + " but got " + (result[i] & 0xFF));
     //        }
     //    }
     //}
     return(result);
 }
 public void ReadFully(byte[] buf, int off, int len)
 {
     _le.ReadFully(buf, off, len);
     _rc4.Xor(buf, off, len);
 }
예제 #8
0
 private static byte[] ReadTail(byte[] expectedTail, LittleEndianInput in1)
 {
     byte[] result = new byte[TAIL_SIZE];
     in1.ReadFully(result);
     //if (false)
     //{ // Quite a few examples in the unit tests which don't have the exact expected tail
     //    for (int i = 0; i < expectedTail.Length; i++)
     //    {
     //        if (expectedTail[i] != result[i])
     //        {
     //            Console.WriteLine("Mismatch in tail byte [" + i + "]"
     //                    + "expected " + (expectedTail[i] & 0xFF) + " but got " + (result[i] & 0xFF));
     //        }
     //    }
     //}
     return result;
 }
        /**
         * Constructs a Group marker record and Sets its fields appropriately.
         *
         * @param in the RecordInputstream to Read the record from
         */

        public GroupMarkerSubRecord(LittleEndianInput in1, int size)
        {
            byte[] buf = new byte[size];
            in1.ReadFully(buf);
            reserved = buf;
        }
예제 #10
0
 public void ReadFully(byte[] buf, int off, int len)
 {
     _le.ReadFully(buf, off, len);
     _currentDataOffset += len;
 }
예제 #11
0
 /**
  * When there are no array constants present, <tt>encodedTokenLen</tt>==<tt>totalEncodedLen</tt>
  * @param encodedTokenLen number of bytes in the stream taken by the plain formula tokens
  * @param totalEncodedLen the total number of bytes in the formula (includes trailing encoding
  * for array constants, but does not include 2 bytes for initial <tt>ushort encodedTokenLen</tt> field.
  * @return A new formula object as read from the stream.  Possibly empty, never <code>null</code>.
  */
 public static Formula Read(int encodedTokenLen, LittleEndianInput in1, int totalEncodedLen)
 {
     byte[] byteEncoding = new byte[totalEncodedLen];
     in1.ReadFully(byteEncoding);
     return new Formula(byteEncoding, encodedTokenLen);
 }
예제 #12
0
        private static byte[] ReadRawData(LittleEndianInput in1, int size)
        {
            if (size < 0)
            {
                throw new ArgumentException("Negative size (" + size + ")");
            }
            if (size == 0)
            {
                return EMPTY_BYTE_ARRAY;
            }
            byte[] result = new byte[size];
		    in1.ReadFully(result);
            return result;
        }
        /**
         * Constructs a Group marker record and Sets its fields appropriately.
         *
         * @param in the RecordInputstream to Read the record from
         */

        public GroupMarkerSubRecord(LittleEndianInput in1, int size)
        {
            byte[] buf = new byte[size];
            in1.ReadFully(buf);
            reserved = buf;
        }
예제 #14
0
 public UnknownSubRecord(LittleEndianInput in1, int sid, int size)
 {
     _sid = sid;
      byte[] buf = new byte[size];
      in1.ReadFully(buf);
      _data = buf;
 }
예제 #15
0
 /**
  * When there are no array constants present, <tt>encodedTokenLen</tt>==<tt>totalEncodedLen</tt>
  * @param encodedTokenLen number of bytes in the stream taken by the plain formula tokens
  * @param totalEncodedLen the total number of bytes in the formula (includes trailing encoding
  * for array constants, but does not include 2 bytes for initial <tt>ushort encodedTokenLen</tt> field.
  * @return A new formula object as read from the stream.  Possibly empty, never <code>null</code>.
  */
 public static Formula Read(int encodedTokenLen, LittleEndianInput in1, int totalEncodedLen)
 {
     byte[] byteEncoding = new byte[totalEncodedLen];
     in1.ReadFully(byteEncoding);
     return(new Formula(byteEncoding, encodedTokenLen));
 }