private static void Write(Stream stream, Documentation documentation) { stream.Position = 0; serializer.Serialize(stream, documentation); stream.SetLength(stream.Position); }