XmlTextReader.ReadContentAsBase64(Byte[], Int32, Int32) Método
Definição
Lê o conteúdo e retorna os bytes binários decodificados Base64.Reads the content and returns the Base64 decoded binary bytes.
public:
override int ReadContentAsBase64(cli::array <System::Byte> ^ buffer, int index, int count);
public override int ReadContentAsBase64 (byte[] buffer, int index, int count);
override this.ReadContentAsBase64 : byte[] * int * int -> int
Public Overrides Function ReadContentAsBase64 (buffer As Byte(), index As Integer, count As Integer) As Integer
Parâmetros
- buffer
- Byte[]
O buffer para o qual o texto resultante será copiado.The buffer into which to copy the resulting text. Este valor pode não ser null.This value cannot be null.
- index
- Int32
O deslocamento do buffer no qual o resultado começará a ser copiado.The offset into the buffer where to start copying the result.
- count
- Int32
O número máximo de bytes a serem copiados para o buffer.The maximum number of bytes to copy into the buffer. O número real de bytes copiados é retornado deste método.The actual number of bytes copied is returned from this method.
Retornos
O número de bytes gravados no buffer.The number of bytes written to the buffer.
Exceções
O valor buffer é null.The buffer value is null.
Não há suporte para ReadContentAsBase64(Byte[], Int32, Int32) no nó atual.ReadContentAsBase64(Byte[], Int32, Int32) is not supported in the current node.
O índice de buffer ou de índice + contagem é maior que o tamanho do buffer alocado.The index into the buffer or index + count is larger than the allocated buffer size.
Comentários
Observação
A partir do .NET Framework 2,0, recomendamos que você crie XmlReader instâncias usando o XmlReader.Create método para aproveitar a nova funcionalidade.Starting with the .NET Framework 2.0, we recommend that you create XmlReader instances by using the XmlReader.Create method to take advantage of new functionality.
Esse método transmite o conteúdo, decodifica o Base64 conteúdo e retorna os bytes binários decodificados (por exemplo, uma Base64 imagem GIF codificada em linha) para o buffer.This method streams the content, decodes the Base64 content, and returns the decoded binary bytes (for example, an inline Base64-encoded GIF image) into the buffer. Esse método pode ser chamado sucessivamente para ler grandes fluxos de texto inseridos.This method can be called successively to read large streams of embedded text. Para obter mais informações, consulte RFC 1521, "MIME (Multipurpose Internet Mail Extensions) Part One: mecanismos para especificar e descrever o formato de corpos de mensagens da Internet".For more information, see RFC 1521, "MIME (Multipurpose Internet Mail Extensions) Part One: Mechanisms for Specifying and Describing the Format of Internet Message Bodies". Você pode obter RFCs no site da Web Request for Comments.You can obtain RFCs from the Request for Comments Web site.
Observação
Você não deve acessar nenhuma das propriedades do leitor entre as chamadas para o ReadContentAsBase64 método até que o método retorne o valor 0.You should not access any of the reader properties between calls to the ReadContentAsBase64 method until the method returns the value 0.
Esse método tem o seguinte comportamento:This method has the following behavior:
ReadContentAsBase64 Retorna o valor 0 quando ele atingiu o final do fluxo de bytes em que estava operando.ReadContentAsBase64 returns the value 0 when it has reached the end of the byte stream it was operating on. O leitor está posicionado no primeiro nó que não é de conteúdo.The reader is positioned on the first non-content node.
Se você solicitar menos, ou o número exato de bytes do que o restante no fluxo, o leitor permanecerá em sua posição atual.If you ask for fewer, or the exact number, of bytes than are left in the stream the reader remains in its current position.
ReadContentAsBase64 Não tem suporte nos seguintes tipos de nó XML:,,,,,
ElementXmlDeclaration,,NoneDocumentDocumentTypeNotationEntityDocumentFragment.ReadContentAsBase64 is not supported on the following XML node types:Element,XmlDeclaration,None,Document,DocumentType,Notation,Entity,DocumentFragment.