Project: Move WPinternals code to a WPinternals folder

This commit is contained in:
Gustave Monce
2021-08-14 11:04:37 +02:00
parent 668a9b7fe2
commit 17bc763761
203 changed files with 48170 additions and 48170 deletions
-52
View File
@@ -1,52 +0,0 @@
// OutBuffer.cs
namespace SevenZip.Buffer
{
public class OutBuffer
{
private readonly byte[] m_Buffer;
private uint m_Pos;
private readonly uint m_BufferSize;
private System.IO.Stream m_Stream;
private ulong m_ProcessedSize;
public OutBuffer(uint bufferSize)
{
m_Buffer = new byte[bufferSize];
m_BufferSize = bufferSize;
}
public void SetStream(System.IO.Stream stream) { m_Stream = stream; }
public void FlushStream() { m_Stream.Flush(); }
public void CloseStream() { m_Stream.Close(); }
public void ReleaseStream() { m_Stream = null; }
public void Init()
{
m_ProcessedSize = 0;
m_Pos = 0;
}
public void WriteByte(byte b)
{
m_Buffer[m_Pos++] = b;
if (m_Pos >= m_BufferSize)
{
FlushData();
}
}
public void FlushData()
{
if (m_Pos == 0)
{
return;
}
m_Stream.Write(m_Buffer, 0, (int)m_Pos);
m_Pos = 0;
}
public ulong GetProcessedSize() { return m_ProcessedSize + m_Pos; }
}
}