本文整理汇总了C#中ILittleEndianInput.ReadFully方法的典型用法代码示例。如果您正苦于以下问题:C# ILittleEndianInput.ReadFully方法的具体用法?C# ILittleEndianInput.ReadFully怎么用?C# ILittleEndianInput.ReadFully使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ILittleEndianInput
的用法示例。
在下文中一共展示了ILittleEndianInput.ReadFully方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NoteStructureSubRecord
/**
* Constructs a NoteStructureSubRecord and Sets its fields appropriately.
*
*/
public NoteStructureSubRecord(ILittleEndianInput 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;
}
示例2: UnknownSubRecord
public UnknownSubRecord(ILittleEndianInput in1, int sid, int size)
{
_sid = sid;
byte[] buf = new byte[size];
in1.ReadFully(buf);
_data = buf;
}
示例3: ReadRawData
private static byte[] ReadRawData(ILittleEndianInput 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;
}
示例4: GroupMarkerSubRecord
/**
* Constructs a Group marker record and Sets its fields appropriately.
*
* @param in the RecordInputstream to Read the record from
*/
public GroupMarkerSubRecord(ILittleEndianInput in1, int size)
{
byte[] buf = new byte[size];
in1.ReadFully(buf);
reserved = buf;
}
示例5: Read
/**
* When there are no array constants present, <c>encodedTokenLen</c>==<c>totalEncodedLen</c>
* @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 <c>ushort encodedTokenLen</c> field.
* @return A new formula object as read from the stream. Possibly empty, never <code>null</code>.
*/
public static Formula Read(int encodedTokenLen, ILittleEndianInput in1, int totalEncodedLen)
{
byte[] byteEncoding = new byte[totalEncodedLen];
in1.ReadFully(byteEncoding);
return new Formula(byteEncoding, encodedTokenLen);
}
示例6: ReadTail
private static byte[] ReadTail(byte[] expectedTail, ILittleEndianInput 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])
// {
// logger.Log( POILogger.ERROR, "Mismatch in tail byte [" + i + "]"
// + "expected " + (expectedTail[i] & 0xFF) + " but got " + (result[i] & 0xFF));
// }
// }
//}
return result;
}
示例7: ReadUnicodeLE
public static String ReadUnicodeLE(ILittleEndianInput in1, int nChars)
{
byte[] bytes = new byte[nChars * 2];
in1.ReadFully(bytes);
return UTF16LE.GetString(bytes);
}
示例8: ReadCompressedUnicode
public static String ReadCompressedUnicode(ILittleEndianInput in1, int nChars)
{
byte[] buf = new byte[nChars];
in1.ReadFully(buf);
return ISO_8859_1.GetString(buf);
}
示例9: Read
/// <summary>
/// Returns <see cref="size"/> bytes from the <see cref="input"/> stream
/// </summary>
/// <param name="input"></param>
/// <param name="size"></param>
/// <returns></returns>
private static byte[] Read(ILittleEndianInput input, int size)
{
var result = new byte[size];
input.ReadFully(result);
return result;
}