// // Licensed under the MIT License. See LICENSE file in the project root for full license information. // namespace MUnique.OpenMU.Network; using System.Diagnostics; using System.IO.Pipelines; /// /// Extensions for . /// public static class PipeWriterExtension { /// /// Advances the and catches possible errors. /// /// The . /// The number of data items written to the or . public static void AdvanceSafely(this PipeWriter pipeWriter, int bytes) { try { pipeWriter.Advance(bytes); } catch (Exception ex) { if (Debugger.IsLogging()) { Debug.Fail(ex.ToString()); } } } }