/// <summary>
 ///     Determines whether the bytes of a signed integer have to be
 ///     swapped according to the used transfer syntax. There is
 ///     considered the endian type of underlying machine and transfer
 ///     syntax.
 /// </summary>
 /// <param name="value">
 ///     Signed integer to process.
 /// </param>
 /// <returns>
 ///     Signed integer with or without bytes swapped.
 /// </returns>
 public int CorrectByteOrdering(int value)
 {
     if ((IsMachineLittleEndian && !IsLittleEndian) ||
         (!IsMachineLittleEndian && IsLittleEndian))
     {
         return(ByteConvert.SwapBytes(value));
     }
     else
     {
         return(value);
     }
 }
 /// <summary>
 ///     Determines whether the bytes of an array have to be swapped
 ///     according to the used transfer syntax. This method only is
 ///     relevant to numeric representations as byte arrays. There is
 ///     considered the endian type of underlying machine and transfer
 ///     syntax.
 /// </summary>
 /// <param name="bytes">
 ///     Byte array to process.
 /// </param>
 /// <returns>
 ///     Byte array with or without bytes swapped.
 /// </returns>
 public byte[] CorrectByteOrdering(byte[] bytes)
 {
     if ((IsMachineLittleEndian && !IsLittleEndian) ||
         (!IsMachineLittleEndian && IsLittleEndian))
     {
         return(ByteConvert.SwapBytes(bytes));
     }
     else
     {
         return(bytes);
     }
 }
 /// <summary>
 ///     Determines whether the bytes of a signed word have to be
 ///     swapped according to the used transfer syntax. There is
 ///     considered the endian type of underlying machine and transfer
 ///     syntax.
 /// </summary>
 /// <param name="word">
 ///     Signed word to process.
 /// </param>
 /// <returns>
 ///     Signed word with or without bytes swapped.
 /// </returns>
 public short CorrectByteOrdering(short word)
 {
     if ((IsMachineLittleEndian && !IsLittleEndian) ||
         (!IsMachineLittleEndian && IsLittleEndian))
     {
         return(ByteConvert.SwapBytes(word));
     }
     else
     {
         return(word);
     }
 }
 /// <summary>
 ///     Converts a string into an array of bytes by this
 ///     DICOM transfer syntax instance's character repertoire.
 /// </summary>
 public virtual byte[] ToBytes(string s)
 {
     return(ByteConvert.ToBytes(s, CharacterRepertoire));
 }
 /// <summary>
 ///     Converts count of bytes from a byte array starting at
 ///     specified offset into a string by this DICOM transfer syntax
 ///     instance's character repertoire.
 /// </summary>
 public virtual string ToString(byte[] bytes, int offset, int count)
 {
     return(ByteConvert.ToString(bytes, offset, count,
                                 CharacterRepertoire));
 }
 /// <summary>
 ///     Converts count of bytes from a byte array into a string by this
 ///     DICOM transfer syntax instance's character repertoire.
 /// </summary>
 public string ToString(byte[] bytes, int count)
 {
     return(ByteConvert.ToString(bytes, count, CharacterRepertoire));
 }
 /// <summary>
 ///     Converts an array of bytes into a string by this
 ///     DICOM transfer syntax instance's character repertoire.
 /// </summary>
 public string ToString(byte[] bytes)
 {
     return(ByteConvert.ToString(bytes, CharacterRepertoire));
 }