本文整理汇总了C#中EvilDICOM.Core.IO.Reading.DICOMBinaryReader.Peek方法的典型用法代码示例。如果您正苦于以下问题:C# DICOMBinaryReader.Peek方法的具体用法?C# DICOMBinaryReader.Peek怎么用?C# DICOMBinaryReader.Peek使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EvilDICOM.Core.IO.Reading.DICOMBinaryReader
的用法示例。
在下文中一共展示了DICOMBinaryReader.Peek方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PeekVR
public static VR PeekVR(DICOMBinaryReader dr)
{
byte[] vrBytes = dr.Peek(2);
char[] vr = Encoding.UTF8.GetChars(vrBytes);
VR foundVR = VRDictionary.GetVRFromAbbreviation(new string(vr));
return foundVR;
}
示例2: ReadUserInfo
public static UserInfo ReadUserInfo(DICOMBinaryReader dr)
{
AssertItemType(dr, "User Info", ItemType.USER_INFO);
var ui = new UserInfo();
dr.Skip(2); // PDU ID and Reserved Null Byte
int length = LengthReader.ReadBigEndian(dr, 2);
if (length > 0)
{
ui.MaxPDULength = (int) ReadMaxLength(dr);
ui.ImplementationUID = ReadImplementationClassUID(dr);
if (dr.Peek(1)[0] == (byte) ItemType.ASYNCHRONOUS_OPERATIONS_WINDOW)
{
ui.AsynchronousOperations = ReadAsyncOperations(dr);
}
ui.ImplementationVersion = ReadImplementationVersion(dr);
}
return ui;
}
示例3: AssertItemType
public static void AssertItemType(DICOMBinaryReader dr, string itemName, ItemType itemType)
{
byte header = dr.Peek(1)[0];
if (header != (byte) itemType)
throw new Exception();
}