public byte[] GetBuffer() { byte[] ret = stream.GetBuffer(); byte[] retdata = new byte[write.BaseStream.Length]; Buffer.BlockCopy(ret, 0, retdata, 0, (int)write.BaseStream.Length); return retdata; }