Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(910)

Side by Side Diff: third_party/lzma/v4_65/files/CS/7zip/Common/OutBuffer.cs

Issue 624713003: Keep only base/extractor.[cc|h]. (Closed) Base URL: https://chromium.googlesource.com/external/omaha.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // OutBuffer.cs
2
3 namespace SevenZip.Buffer
4 {
5 public class OutBuffer
6 {
7 byte[] m_Buffer;
8 uint m_Pos;
9 uint m_BufferSize;
10 System.IO.Stream m_Stream;
11 ulong m_ProcessedSize;
12
13 public OutBuffer(uint bufferSize)
14 {
15 m_Buffer = new byte[bufferSize];
16 m_BufferSize = bufferSize;
17 }
18
19 public void SetStream(System.IO.Stream stream) { m_Stream = stre am; }
20 public void FlushStream() { m_Stream.Flush(); }
21 public void CloseStream() { m_Stream.Close(); }
22 public void ReleaseStream() { m_Stream = null; }
23
24 public void Init()
25 {
26 m_ProcessedSize = 0;
27 m_Pos = 0;
28 }
29
30 public void WriteByte(byte b)
31 {
32 m_Buffer[m_Pos++] = b;
33 if (m_Pos >= m_BufferSize)
34 FlushData();
35 }
36
37 public void FlushData()
38 {
39 if (m_Pos == 0)
40 return;
41 m_Stream.Write(m_Buffer, 0, (int)m_Pos);
42 m_Pos = 0;
43 }
44
45 public ulong GetProcessedSize() { return m_ProcessedSize + m_Pos ; }
46 }
47 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698