internal SqlCachedBuffer(SqlMetaDataPriv metadata, TdsParser parser, TdsParserStateObject stateObj)
{
int len = 0;
this._cachedBytes = new ArrayList();
ulong num = parser.PlpBytesLeft(stateObj);
do
{
if (num == 0L)
{
return;
}
do
{
len = (num > 0x800L) ? 0x800 : ((int) num);
byte[] buff = new byte[len];
len = stateObj.ReadPlpBytes(ref buff, 0, len);
if (this._cachedBytes.Count == 0)
{
this.AddByteOrderMark(buff);
}
this._cachedBytes.Add(buff);
num -= len;
}
while (num > 0L);
num = parser.PlpBytesLeft(stateObj);
}
while (num > 0L);
}