private void InitializeWriting()
{
FailIfReadOnlyBody();
if(this.dataOut == null)
{
this.outputBuffer = new MemoryStream();
Stream target = this.outputBuffer;
if(this.Connection != null && this.Connection.UseCompression)
{
this.length = 0;
this.Compressed = true;
target = this.Connection.CompressionPolicy.CreateCompressionStream(target);
target = new LengthTrackerStream(target, this);
}
this.dataOut = new EndianBinaryWriter(target);
}
}