Terraria.ModLoader.ModPacket.Finish C# (CSharp) Method

Finish() private method

private Finish ( ) : void
return void
		private void Finish() {
			if (buf != null)
				return;

			if (OutStream.Position > ushort.MaxValue)
				throw new Exception("Packet too large " + OutStream.Position + " > " + ushort.MaxValue);

			len = (ushort)OutStream.Position;
			Seek(0, SeekOrigin.Begin);
			Write(len);
			Close();
			buf = ((MemoryStream) OutStream).GetBuffer();
		}
	}