internal void Write(int numBytes, IStreamByteDistributorWriter writer)
 {
     Debug.Assert(_stream is object);
     try
     {
         writer.Write(_stream, numBytes);
     }
     catch (Exception t)
     {
         ThrowHelper.ThrowConnectionError_ByteDistributionWriteError(t);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Write any allocated bytes for the given stream and updates the streamable bytes,
 /// assuming all of the bytes will be written.
 /// </summary>
 /// <param name="numBytes"></param>
 /// <param name="writer"></param>
 public void Write(int numBytes, IStreamByteDistributorWriter writer)
 {
     _writing = true;
     try
     {
         // Write the allocated bytes.
         writer.Write(_stream, numBytes);
     }
     catch (Exception t)
     {
         ThrowHelper.ThrowConnectionError_ByteDistributionWriteError(t);
     }
     finally
     {
         _writing = false;
     }
 }