本文整理汇总了C#中ICSharpCode.SharpZipLib.Zip.Compression.Streams.StreamManipulator.CopyBytes方法的典型用法代码示例。如果您正苦于以下问题:C# StreamManipulator.CopyBytes方法的具体用法?C# StreamManipulator.CopyBytes怎么用?C# StreamManipulator.CopyBytes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICSharpCode.SharpZipLib.Zip.Compression.Streams.StreamManipulator
的用法示例。
在下文中一共展示了StreamManipulator.CopyBytes方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CopyStored
public int CopyStored(StreamManipulator input, int length)
{
length = Math.Min(Math.Min(length, WindowSize - windowFilled), input.AvailableBytes);
int copied;
int tailLen = WindowSize - windowEnd;
if (length > tailLen) {
copied = input.CopyBytes(window, windowEnd, tailLen);
if (copied == tailLen) {
copied += input.CopyBytes(window, 0, length - tailLen);
}
} else {
copied = input.CopyBytes(window, windowEnd, length);
}
windowEnd = (windowEnd + copied) & WindowMask;
windowFilled += copied;
return copied;
}
示例2: CopyStored
public int CopyStored(StreamManipulator input, int length)
{
int num;
length = Math.Min(Math.Min(length, 0x8000 - this.windowFilled), input.AvailableBytes);
int num2 = 0x8000 - this.windowEnd;
if (length > num2)
{
num = input.CopyBytes(this.window, this.windowEnd, num2);
if (num == num2)
{
num += input.CopyBytes(this.window, 0, length - num2);
}
}
else
{
num = input.CopyBytes(this.window, this.windowEnd, length);
}
this.windowEnd = (this.windowEnd + num) & 0x7fff;
this.windowFilled += num;
return num;
}
示例3: CopyStored
public int CopyStored(StreamManipulator input, int length)
{
length = Math.Min(Math.Min(length, 32768 - this.windowFilled), input.AvailableBytes);
int num = 32768 - this.windowEnd;
int num2;
if (length > num)
{
num2 = input.CopyBytes(this.window, this.windowEnd, num);
if (num2 == num)
{
num2 += input.CopyBytes(this.window, 0, length - num);
}
}
else
{
num2 = input.CopyBytes(this.window, this.windowEnd, length);
}
this.windowEnd = (this.windowEnd + num2 & 32767);
this.windowFilled += num2;
return num2;
}
示例4: CopyStored
/// <summary>
/// Copy from input manipulator to internal window
/// </summary>
/// <param name="input">source of data</param>
/// <param name="len">length of data to copy</param>
/// <returns>the number of bytes copied</returns>
public int CopyStored(StreamManipulator input, int len)
{
len = Math.Min(Math.Min(len, WINDOW_SIZE - windowFilled), input.AvailableBytes);
int copied;
int tailLen = WINDOW_SIZE - windowEnd;
if (len > tailLen) {
copied = input.CopyBytes(window, windowEnd, tailLen);
if (copied == tailLen) {
copied += input.CopyBytes(window, 0, len - tailLen);
}
} else {
copied = input.CopyBytes(window, windowEnd, len);
}
windowEnd = (windowEnd + copied) & WINDOW_MASK;
windowFilled += copied;
return copied;
}