Beispiel #1
0
 public static Segment Get(int size)
 {
     lock (msSegmentPool)
     {
         if (msSegmentPool.Count > 0)
         {
             var seg = msSegmentPool.Pop();
             seg.data = ByteBuffer.Allocate(size, true);
             return(seg);
         }
     }
     return(new Segment(size));
 }
Beispiel #2
0
 private Segment(int size)
 {
     data = ByteBuffer.Allocate(size, true);
 }