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