Lines Matching defs:encoding
255 /// Creates a new <see cref="ByteString" /> by encoding the specified text with
256 /// the given encoding.
258 public static ByteString CopyFrom(string text, Encoding encoding)
260 return new ByteString(encoding.GetBytes(text));
264 /// Creates a new <see cref="ByteString" /> by encoding the specified text in UTF-8.
280 /// Converts this <see cref="ByteString"/> into a string by applying the given encoding.
283 /// This method should only be used to convert binary data which was the result of encoding
284 /// text with the given encoding.
286 /// <param name="encoding">The encoding to use to decode the binary data into text.</param>
288 public string ToString(Encoding encoding)
290 return encoding.GetString(bytes, 0, bytes.Length);
294 /// Converts this <see cref="ByteString"/> into a string by applying the UTF-8 encoding.
297 /// This method should only be used to convert binary data which was the result of encoding