Example #1
0
        /// <summary>
        /// "Move" the packet data out of the buffer we're sitting on and into
        /// buf at the current position.
        /// </summary>
        internal void movePacket(ByteBuffer buf)
        {
            Log.v("ddms", "moving " + mLength + " bytes");
            int oldPosn = mBuffer.position;

            mBuffer.position = (0);
            mBuffer.limit =(mLength);
            buf.put(mBuffer);
            mBuffer.position=(mLength);
            mBuffer.limit=(oldPosn);
            mBuffer.compact(); // shift posn...limit, posn<-pending data
        }
Example #2
0
 /// <summary>
 /// Copy the handshake string into the output buffer.
 /// 
 /// On exit, "buf"s position will be advanced.
 /// </summary>
 internal static void putHandshake(ByteBuffer buf)
 {
     buf.put(mHandshake);
 }