本文整理汇总了C#中X360.IO.DJsIO.GetBytes方法的典型用法代码示例。如果您正苦于以下问题:C# DJsIO.GetBytes方法的具体用法?C# DJsIO.GetBytes怎么用?C# DJsIO.GetBytes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类X360.IO.DJsIO
的用法示例。
在下文中一共展示了DJsIO.GetBytes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: xExtractBytes
public byte[] xExtractBytes()
{
byte[] ret = null;
var xIO = new DJsIO(true);
try
{
if (xExtract(ref xIO))
{
xIO.Position = 0;
ret = xIO.GetBytes();
}
}
catch
{
ret = null;
}
xIO.Close();
return ret;
}
示例2: STFSPackage
//.........这里部分代码省略.........
throw CryptoExcepts.ParamError;
if (xSession.xFileDirectory.Count == 0)
throw new Exception();
////try
{
//AddToLog("Setting Package variables");
xroot = new FolderEntry("", 0, 0xFFFF, 0xFFFF, this);
if (xSession.HeaderData.ThisType == PackageType.GamesOnDemand ||
xSession.HeaderData.ThisType == PackageType.HDDInstalledGame ||
xSession.HeaderData.ThisType == PackageType.OriginalXboxGame ||
xSession.HeaderData.ThisType == PackageType.SocialTitle)
throw STFSExcepts.Game;
xLog = LogIn;
xHeader = xSession.HeaderData;
xSTFSStruct = new STFSDescriptor(xSession.STFSType, 0);
xIO = new DJsIO();
var DirectoryBlockz = new List<BlockRecord>();
// switched2 = true;
uint xcurblock = 0;
for (ushort i = 0; i < xSession.GetDirectoryCount; i++)
{
DirectoryBlockz.Add(new BlockRecord());
DirectoryBlockz[DirectoryBlockz.Count - 1].ThisBlock = xcurblock++;
}
xFileBlocks = DirectoryBlockz.ToArray();
xWriteChain(xFileBlocks);
xSTFSStruct.xDirectoryBlockCount = (ushort)xFileBlocks.Length;
ushort xCurID = 0;
xSession.xFolderDirectory.Sort(new Comparison<CFolderEntry>(sortpathct));
foreach (var x in xSession.xFolderDirectory)
{
ushort pointer = 0xFFFF;
if (x.xthispath.xPathCount() > 1)
pointer = xGetParentFolder(x.Path).EntryID;
xFolderDirectory.Add(new FolderEntry(x.Name, 0, xCurID++, pointer, this));
xFolderDirectory[xFolderDirectory.Count - 1].xFixOffset();
}
foreach (CFileEntry x in xSession.xFileDirectory)
{
ushort pointer = 0xFFFF;
if (x.xthispath.xPathCount() > 1)
pointer = xGetParentFolder(x.Path).EntryID;
xFileDirectory.Add(new FileEntry(x.Name,
(int)x.GetLength(), false, xCurID++, pointer, this));
var xAlloc = new List<BlockRecord>();
for (uint i = 0; i < x.BlockCount(); i++)
{
xAlloc.Add(new BlockRecord());
xAlloc[xAlloc.Count - 1].ThisBlock = xcurblock++;
}
xFileDirectory[xFileDirectory.Count - 1].xBlockCount = (uint)xAlloc.Count;
xFileDirectory[xFileDirectory.Count - 1].xStartBlock = xAlloc[0].ThisBlock;
xFileDirectory[xFileDirectory.Count - 1].xPackage = this;
xFileDirectory[xFileDirectory.Count - 1].xFixOffset();
xWriteChain(xAlloc.ToArray());
}
//AddToLog("Writing Entry Table");
DJsIO xent;
if (!xEntriesToFile(out xent))
throw new Exception();
xWriteTo(ref xent, xFileBlocks);
xent.Close();
//VariousFunctions.DeleteFile(xent.FileNameLong);
//AddToLog("Writing Files");
uint curblck = xSession.GetDirectoryCount;
foreach (var z in xSession.xFileDirectory)
{
var w = new List<BlockRecord>();
uint ct = z.BlockCount();
for (uint y = 0; y < ct; y++)
{
w.Add(new BlockRecord());
w[w.Count - 1].ThisBlock = curblck++;
}
DJsIO x = null;
//try
{
x = new DJsIO(z.FileData, true);
xWriteTo(ref x, w.ToArray());
}
//catch { }
if (x != null)
x.Dispose();
}
xWriteTables();
xWriteHeader(xSigning);
ret = xIO.GetBytes();
xIO.Close();
//VariousFunctions.MoveFile(xIO.FileNameLong, xOutPath);
xActive = false;
}
////catch (Exception x) { xFileDirectory = null; xFolderDirectory = null; xIO.Dispose(); throw x; }
}