BinaryFormatter.UnsafeDeserialize(Stream, HeaderHandler) Método
Definição
Desserializa o fluxo especificado em um grafo de objeto.Deserializes the specified stream into an object graph. O HeaderHandler fornecido manipula qualquer cabeçalho nesse fluxo.The provided HeaderHandler handles any headers in that stream.
public:
System::Object ^ UnsafeDeserialize(System::IO::Stream ^ serializationStream, System::Runtime::Remoting::Messaging::HeaderHandler ^ handler);
[System.Runtime.InteropServices.ComVisible(false)]
public object UnsafeDeserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler);
[System.Runtime.InteropServices.ComVisible(false)]
[System.Security.SecurityCritical]
public object UnsafeDeserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler);
[<System.Runtime.InteropServices.ComVisible(false)>]
member this.UnsafeDeserialize : System.IO.Stream * System.Runtime.Remoting.Messaging.HeaderHandler -> obj
[<System.Runtime.InteropServices.ComVisible(false)>]
[<System.Security.SecurityCritical>]
member this.UnsafeDeserialize : System.IO.Stream * System.Runtime.Remoting.Messaging.HeaderHandler -> obj
Public Function UnsafeDeserialize (serializationStream As Stream, handler As HeaderHandler) As Object
Parâmetros
- serializationStream
- Stream
O fluxo do qual desserializar o grafo do objeto.The stream from which to deserialize the object graph.
- handler
- HeaderHandler
O HeaderHandler que manipula qualquer cabeçalho no serializationStream.The HeaderHandler that handles any headers in the serializationStream. Pode ser null.Can be null.
Retornos
O objeto desserializado ou o objeto superior (raiz) do grafo de objeto.The deserialized object or the top object (root) of the object graph.
- Atributos
Exceções
O serializationStream é null.The serializationStream is null.
O serializationStream dá suporte a busca, mas seu tamanho é 0.The serializationStream supports seeking, but its length is 0.
O chamador não tem a permissão necessária.The caller does not have the required permission.
Comentários
Os cabeçalhos são usados somente para aplicativos remotos específicos.Headers are used only for specific remoting applications.
Esse método usa SecurityAction.LinkDemand para impedir que ele seja chamado de código não confiável; somente o chamador imediato deve ter SecurityPermissionAttribute.SerializationFormatter permissão.This method uses SecurityAction.LinkDemand to prevent it from being called from untrusted code; only the immediate caller is required to have SecurityPermissionAttribute.SerializationFormatter permission. Não use esse método se seu código puder ser chamado a partir de código parcialmente confiável.Do not use this method if your code can be called from partially trusted code. Em cenários parcialmente confiáveis, use Deserialize em vez disso.In partially trusted scenarios, use Deserialize instead. Em cenários de confiança total, o UnsafeDeserialize fornece um desempenho melhor do que o Deserialize .In full trust scenarios, UnsafeDeserialize provides better performance than Deserialize.
Para a desserialização bem-sucedida, a posição atual no fluxo deve estar no início do grafo do objeto.For successful deserialization, the current position in the stream must be at the beginning of the object graph.
Importante
Chamar este método quando você tiver dados não confiáveis é um risco à segurança.Calling this method with untrusted data is a security risk. Chame esse método apenas quando você tiver dados confiáveis.Call this method only with trusted data. Para obter mais informações, confira Validação de dados.For more information, see Data Validation.