Skip to content

Commit

Permalink
Add Encoding.GetString() method (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
josesimoes authored Aug 2, 2018
1 parent ddd69d0 commit a63a648
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions source/System/Text/Encoding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,18 @@ public virtual char[] GetChars(byte[] bytes, int byteIndex, int byteCount)
throw new NotImplementedException();
}

/// <summary>
/// When overridden in a derived class, decodes a sequence of bytes from the specified byte array into a <see cref="String"/>.
/// </summary>
/// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
/// <param name="index">The index of the first byte to decode.</param>
/// <param name="count">The number of bytes to decode.</param>
/// <returns>A <see cref="String"/> that contains the results of decoding the specified sequence of bytes.</returns>
public virtual string GetString(byte[] bytes, int index, int count)
{
return new string(GetChars(bytes, index, count));
}

/// <summary>
/// When overridden in a derived class, obtains a decoder that converts an encoded sequence of bytes into a sequence of characters.
/// </summary>
Expand Down

0 comments on commit a63a648

Please sign in to comment.