/// <summary>
 ///     Creates a <see cref="BinaryWriter" /> over this array segment.
 /// </summary>
 /// <param name="segment">The array segment.</param>
 /// <returns>A new <see cref="BinaryWriter" />.</returns>
 public static BinaryWriter CreateBinaryWriter(this ArraySegment <byte> segment)
 {
     return(new BinaryWriter(segment.CreateStream()));
 }
 /// <summary>
 ///     Creates a <see cref="BinaryReader" /> over this array segment.
 /// </summary>
 /// <param name="segment">The array segment.</param>
 /// <returns>A new <see cref="BinaryReader" />.</returns>
 public static BinaryReader CreateBinaryReader(this ArraySegment <byte> segment)
 {
     return(new BinaryReader(segment.CreateStream(false)));
 }