From 6fc54a43f0b49ea46251de3c21fbb91231ba14cc Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Fri, 15 Oct 2010 22:00:58 +0000 Subject: [PATCH] Removed optional parameter to DeserializeLLSDBinary(), decode binary serialized data both with and without the header. git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@3456 52acb1d6-8a22-11de-b505-999d5b087335 --- .../LLSD/BinaryLLSD.cs | 29 +++---------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/OpenMetaverse.StructuredData/LLSD/BinaryLLSD.cs b/OpenMetaverse.StructuredData/LLSD/BinaryLLSD.cs index 1c66082f..4cd6d925 100644 --- a/OpenMetaverse.StructuredData/LLSD/BinaryLLSD.cs +++ b/OpenMetaverse.StructuredData/LLSD/BinaryLLSD.cs @@ -79,21 +79,10 @@ namespace OpenMetaverse.StructuredData /// Serialized data /// OSD containting deserialized data public static OSD DeserializeLLSDBinary(byte[] binaryData) - { - return DeserializeLLSDBinary(binaryData, false); - } - - /// - /// Deserializes binary LLSD - /// - /// Serialized data - /// Treat LLSD binary header as optional - /// OSD containting deserialized data - public static OSD DeserializeLLSDBinary(byte[] binaryData, bool headerOptional) { MemoryStream stream = new MemoryStream(binaryData); - OSD osd = DeserializeLLSDBinary(stream, headerOptional); + OSD osd = DeserializeLLSDBinary(stream); stream.Close(); return osd; } @@ -104,17 +93,6 @@ namespace OpenMetaverse.StructuredData /// Stream to read the data from /// OSD containting deserialized data public static OSD DeserializeLLSDBinary(Stream stream) - { - return DeserializeLLSDBinary(stream, false); - } - - /// - /// Deserializes binary LLSD - /// - /// Stream to read the data from - /// Treat LLSD binary header as optional - /// OSD containting deserialized data - public static OSD DeserializeLLSDBinary(Stream stream, bool headerOptional) { if (!stream.CanSeek) throw new OSDException("Cannot deserialize binary LLSD from unseekable streams"); @@ -122,8 +100,9 @@ namespace OpenMetaverse.StructuredData SkipWhiteSpace(stream); if (!FindString(stream, llsdBinaryHead) && !FindString(stream, llsdBinaryHead2)) - if (!headerOptional) - throw new OSDException("Failed to decode binary LLSD"); + { + //throw new OSDException("Failed to decode binary LLSD"); + } SkipWhiteSpace(stream);