コード例 #1
0
 public override unsafe int GetByteCount(char *chars, int count)
 {
     return(EncodingForwarder.GetByteCount(this, chars, count));
 }
コード例 #2
0
        // NOTE: Many methods in this class forward to EncodingForwarder for
        // validating arguments/wrapping the unsafe methods in this class
        // which do the actual work. That class contains
        // shared logic for doing this which is used by
        // ASCIIEncoding, EncodingNLS, UnicodeEncoding, UTF32Encoding,
        // UTF7Encoding, and UTF8Encoding.
        // The reason the code is separated out into a static class, rather
        // than a base class which overrides all of these methods for us
        // (which is what EncodingNLS is for internal Encodings) is because
        // that's really more of an implementation detail so it's internal.
        // At the same time, C# doesn't allow a public class subclassing an
        // internal/private one, so we end up having to re-override these
        // methods in all of the public Encodings + EncodingNLS.

        // Returns the number of bytes required to encode a range of characters in
        // a character array.

        public override int GetByteCount(char[] chars, int index, int count)
        {
            return(EncodingForwarder.GetByteCount(this, chars, index, count));
        }
コード例 #3
0
 public override int GetByteCount(String s)
 {
     return(EncodingForwarder.GetByteCount(this, s));
 }
コード例 #4
0
 public override int GetByteCount(string chars)
 {
     return(EncodingForwarder.GetByteCount(this, chars));
 }