Write method

  1. @override
void Write(
  1. Uint8List buffer,
  2. int offset,
  3. int count
)
When overridden in a derived class, reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read. An array of bytes. When this method returns, the buffer contains the specified byte array with the values between

Implementation

// @override
// Future<int> Read(Uint8List buffer, int offset, int count) async {
//   List<List<int>> buffer = await this.underlyingStream.take(
//       count); // int retVal = this.underlyingStream.Read(buffer, offset, count);
//   List<int> flatterBuffer = buffer.expand((it) => it).toList(growable: false);
//   int retVal = flatterBuffer.length;
//
//   if (HangingServiceRequestBase.LogAllWireBytes) {
//     String readString = utf8.decode(flatterBuffer);
//     String logMessage =
//         "HangingTraceStream ID [${this.hashCode}] returned ${retVal} bytes. Bytes returned: [${readString}]";
//
//     this.service.TraceMessage(TraceFlags.DebugMessage, logMessage);
//   }
//
//   if (this.responseCopy != null) {
//     this
//         .responseCopy!
//         .Write(Uint8List.fromList(flatterBuffer), offset, retVal);
//   }
//
//   return retVal;
// }

/// <summary>
/// Sets the position within the current stream.
/// </summary>
/// <param name="offset">A byte offset relative to the <paramref name="origin"/> parameter.</param>
/// <param name="origin">A value of type <see cref="T:System.IO.SeekOrigin"/> indicating the reference point used to obtain the new position.</param>
/// <returns>
/// The new position within the current stream.
/// </returns>
/// <exception cref="T:System.NotSupportedException">The stream does not support seeking. </exception>
// @override
//  int Seek(int offset, SeekOrigin origin)
//         {
//             throw new NotSupportedException();
//         }

/// <summary>
/// Sets the length of the current stream.
/// </summary>
/// <param name="value">The desired length of the current stream in bytes.</param>
/// <exception cref="T:System.NotSupportedException">The stream does not support both writing and seeking, such as if the stream is constructed from a pipe or console output. </exception>
// @override
//  void SetLength(long value)
//         {
//             throw new NotSupportedException();
//         }

/// <summary>
/// Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.
/// </summary>
/// <param name="buffer">An array of bytes. This method copies <paramref name="count"/> bytes from <paramref name="buffer"/> to the current stream.</param>
/// <param name="offset">The zero-based byte offset in <paramref name="buffer"/> at which to begin copying bytes to the current stream.</param>
/// <param name="count">The number of bytes to be written to the current stream.</param>
/// <exception cref="T:System.NotSupportedException">The stream does not support writing. </exception>
@override
void Write(Uint8List buffer, int offset, int count) {
  throw new NotSupportedException();
}