コード例 #1
0
ファイル: InputDataStream.cs プロジェクト: BDizzle/BeepForNet
 /// <summary>Creates a <code>InputDataStream</code>.</summary>
 /// <param name="buf">The first buffer in the data stream.</param>
 internal InputDataStream(BufferSegment buf, bool complete)
     : this(buf)
 {
     if (complete)
     {
         this.setComplete();
     }
 }
コード例 #2
0
ファイル: InputDataStream.cs プロジェクト: BDizzle/BeepForNet
 /// <summary>Creates a <code>InputDataStream</code>.</summary>
 /// <param name="buf">The first buffer in the data stream.</param>
 internal InputDataStream(BufferSegment buf)
 {
     this.add(buf);
 }
コード例 #3
0
ファイル: InputDataStream.cs プロジェクト: BDizzle/BeepForNet
        internal virtual void add(BufferSegment segment)
        {
            if (this.closed)
            {
                if (this.channel != null)
                {
                    this.channel.freeReceiveBufferBytes(segment.Length);
                }
                return ;
            }

            lock (this.buffers)
            {
                this.buffers.Add(segment);
                System.Threading.Monitor.Pulse(this.buffers);
            }
            this.availableBytes += segment.Length;
        }
コード例 #4
0
ファイル: Frame.cs プロジェクト: BDizzle/BeepForNet
        /// <summary>Returns an array of <code>BufferSegment</code> objects.</summary>
        public virtual BufferSegment[] getBytes()
        {
            BufferSegment[] b = new BufferSegment[this.payload.Count + 2];
            this.size = 0;

            int j = 1;
            foreach(BufferSegment bs in this.payload)
            {
                b[j] = bs;
                this.size += b[j].Length;
                ++j;
            }

            b[0] = new BufferSegment(buildHeader());
            b[j] = trailerBufferSegment;

            return b;
        }
コード例 #5
0
ファイル: Frame.cs プロジェクト: BDizzle/BeepForNet
 /// <summary>Adds the <code>BufferSegment</code> to the list representing the
 /// payload for this frame.</summary>
 public virtual void addPayload(BufferSegment buf)
 {
     this.payload.Add(buf);
 }
コード例 #6
0
        /// <summary>If there are no bytes remaining in the current buffer move to
        /// the next one if it exists.</summary>
        private bool setNextBuffer()
        {
            while (pos == curBuf.Length)
            {
                if (ids.availableSegment() == false)
                {
                    return false;
                }

                curBuf = ids.NextSegment;
                pos = 0;
            }

            return true;
        }
コード例 #7
0
 private void InitBlock()
 {
     curBuf = zeroLength;
     log = LogFactory.getLog(this.GetType());
     state = STATE_INIT;
     name = new System.IO.MemoryStream(32);
     value_Renamed = new System.IO.MemoryStream(32);
     mimeHeaders = new System.Collections.Hashtable(DEFAULT_HEADER_TABLE_SIZE);
 }