本文整理汇总了C#中BlueSheep.Common.IO.BigEndianReader.Seek方法的典型用法代码示例。如果您正苦于以下问题:C# BigEndianReader.Seek方法的具体用法?C# BigEndianReader.Seek怎么用?C# BigEndianReader.Seek使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BlueSheep.Common.IO.BigEndianReader
的用法示例。
在下文中一共展示了BigEndianReader.Seek方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
public void Init(string filePath)
{
FileInfo fileInfo = new FileInfo(filePath);
if (!fileInfo.Exists)
throw new Exception("I18n file not readable.");
if (m_Indexes == null)
m_Indexes = new Dictionary<int, int>();
if (m_UnDiacriticalIndex == null)
m_UnDiacriticalIndex = new Dictionary<int, int>();
if (m_TextIndexes == null)
m_TextIndexes = new Dictionary<string, int>();
if (m_TextIndexesOverride == null)
m_TextIndexesOverride = new Dictionary<string, string>();
if (m_TextSortIndex == null)
m_TextSortIndex = new Dictionary<int, int>();
byte[] fileContent = new byte[fileInfo.Length];
FileStream fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read);
fileStream.Read(fileContent, 0, fileContent.Length);
fileStream.Dispose();
m_Stream = new BigEndianReader(fileContent);
int position = m_Stream.ReadInt();
m_Stream.Seek(position);
int indexCount = m_Stream.ReadInt();
for (int index = 0; index < indexCount; index += 9)
{
int key = m_Stream.ReadInt();
bool diacriticalText = m_Stream.ReadBoolean();
int pointeur = m_Stream.ReadInt();
m_Indexes.Add(key, pointeur);
if (diacriticalText)
{
index += 4;
m_UnDiacriticalIndex.Add(key, m_Stream.ReadInt());
}
else
m_UnDiacriticalIndex.Add(key, pointeur);
}
int textIndexesCount = m_Stream.ReadInt();
while (textIndexesCount > 0)
{
position = (int) m_Stream.Position;
m_TextIndexes.Add(m_Stream.ReadUTF(), m_Stream.ReadInt());
textIndexesCount -= (int) (m_Stream.Position - position);
}
textIndexesCount = m_Stream.ReadInt();
int i = 0;
while (textIndexesCount > 0)
{
position = (int)m_Stream.Position;
m_TextSortIndex.Add(m_Stream.ReadInt(), ++i);
textIndexesCount -= (int)(m_Stream.Position - position);
}
}