public void ReadFully(byte[] buf, int off, int len) { CheckRecordPosition(len); _dataInput.ReadFully(buf, off, len); _currentDataOffset += len; pos += len; }
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; }
/** * 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; }
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); }
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); }
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; }
public void ReadFully(byte[] buf, int off, int len) { _le.ReadFully(buf, off, len); _currentDataOffset += len; }
/** * 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); }
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; }
public UnknownSubRecord(LittleEndianInput in1, int sid, int size) { _sid = sid; byte[] buf = new byte[size]; in1.ReadFully(buf); _data = buf; }
/** * 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)); }