System.Xml.XmlDictionaryReader.ReadContentAsBase64 C# (CSharp) Méthode

ReadContentAsBase64() private méthode

private ReadContentAsBase64 ( int maxByteArrayContentLength, int maxInitialCount ) : byte[]
maxByteArrayContentLength int
maxInitialCount int
Résultat byte[]
        internal byte[] ReadContentAsBase64(int maxByteArrayContentLength, int maxInitialCount)
        {
            int length;
            if (TryGetBase64ContentLength(out length))
            {
                if (length <= maxInitialCount)
                {
                    byte[] buffer = new byte[length];
                    int read = 0;
                    while (read < length)
                    {
                        int actual = ReadContentAsBase64(buffer, read, length - read);
                        if (actual == 0)
                            XmlExceptionHelper.ThrowBase64DataExpected(this);
                        read += actual;
                    }
                    return buffer;
                }
            }
            return ReadContentAsBytes(true, maxByteArrayContentLength);
        }

Same methods

XmlDictionaryReader::ReadContentAsBase64 ( ) : byte[]

Usage Example

 public BinaryBodyReader(XmlDictionaryReader reader)
 {
     reader.ReadStartElement(BinaryElementName);
     _data = reader.ReadContentAsBase64();
     if (reader.NodeType == XmlNodeType.Text) reader.Read();
     reader.ReadEndElement();
 }
All Usage Examples Of System.Xml.XmlDictionaryReader::ReadContentAsBase64