Example #1
0
 public override void Write(byte[] buffer, int offset, int count)
 {
     if (buffer.Length != count)
     {
         _pipeNetworkStream.Write(buffer.Take(count).ToArray(), offset, count);
     }
     else
     {
         _pipeNetworkStream.Write(buffer, offset, count);
     }
 }
        public override Task WriteToStreamAsync(PipeNetworkStream stream, byte[] data)
#endif
        {
#if (NET35 || NET40)
            stream.Write(data, 0, data.Length);
#else
            return(stream.WriteAsync(data, 0, data.Length));
#endif
        }
 public void WriteBlockToStream(PipeNetworkStream stream, byte[] data)
 {
     byte[] size = BitConverter.GetBytes(data.Length);
     stream.Write(size, 0, data.Length);
     stream.Write(data, 0, data.Length);
 }
 public virtual void WriteToStream(PipeNetworkStream stream, byte[] data)
 {
     stream.Write(data, 0, data.Length);
 }