示例#1
0
		public void Write(byte[] buffer, uint offset = 0, uint count = uint.MaxValue, ByteTargetCallback callback = null, object state = null) {
			if (count == uint.MaxValue)
				count = (uint)buffer.Length - offset;

			if (callback != null)
				_stream.BeginWrite(buffer, (int)offset, (int)count, OnEndWrite, new Tuple<ByteTargetCallback, object>(callback, state));
			else
				_stream.Write(buffer, (int)offset, (int)count);
		}
示例#2
0
        public void Write(byte[] buffer, uint offset = 0, uint count = uint.MaxValue, ByteTargetCallback callback = null, object state = null)
        {
            if (count == uint.MaxValue)
            {
                count = (uint)buffer.Length - offset;
            }

            if (callback != null)
            {
                _stream.BeginWrite(buffer, (int)offset, (int)count, OnEndWrite, new Tuple <ByteTargetCallback, object>(callback, state));
            }
            else
            {
                _stream.Write(buffer, (int)offset, (int)count);
            }
        }