CircularBuffer.cs revision 1b33c96954667ba382fa595baf7b31290bfdd517
//
// � Copyright Henrik Ravn 2004
//
// Use, modification and distribution are subject to the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
using System;
using System.Diagnostics;
namespace DotZLib
{
/// <summary>
/// This class implements a circular buffer
/// </summary>
internal class CircularBuffer
{
private int _capacity;
private int _head;
private int _tail;
private int _size;
private byte[] _buffer;
public CircularBuffer(int capacity)
{
_head = 0;
_tail = 0;
_size = 0;
}
{
for (int i = 0; i < trueCount; ++i)
return trueCount;
}
public bool Put(byte b)
{
return false;
++_size;
return true;
}
{
for (int i = 0; i < trueCount; ++i)
return trueCount;
}
public int Get()
{
if (Size == 0)
return -1;
--_size;
return result;
}
}
}