示例#1
0
        public static DynamicOutputBuffer Get(int code)
        {
            lock (BufferCache)
            {
                foreach (var db in BufferCache)
                {
                    if (!db.Used())
                    {
                        db.Reset(code);
                        return(db);
                    }
                }

                DynamicOutputBuffer b = new DynamicOutputBuffer(code);
                b.Reset(code);
                BufferCache.Add(b);
                return(b);
            }
        }