using System;
using System.Collections.Generic;
using System.Text;
namespace NETPCryptLib
{
class CNETBufTemp
{
public int blocksize;
public int ires;
byte[] bres;
public CNETBufTemp(int pblocksize)
{
blocksize = pblocksize;
ires = 0;
bres = new byte[blocksize];
}
public void AddInit(ref byte[] buffer, ref int bufferlen)
{
if (ires != 0)
{
if (ires + bufferlen >= blocksize)
{
Buffer.BlockCopy(buffer, 0, buffer, ires, bufferlen);
Buffer.BlockCopy(bres, 0, buffer, 0, ires);
bufferlen += ires;
ires = 0;
}
}
}
public void AddEnd(ref byte[] buffer, int poffset, int size)
{
if (size > 0)
{
Buffer.BlockCopy(buffer, poffset, bres, ires, size);
ires += size;
}
}
}
}