Removed optional parameter to DeserializeLLSDBinary(), decode binary serialized data both with and without the <? LLSD/Binary ?> header.
git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@3456 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
@@ -79,21 +79,10 @@ namespace OpenMetaverse.StructuredData
|
||||
/// <param name="binaryData">Serialized data</param>
|
||||
/// <returns>OSD containting deserialized data</returns>
|
||||
public static OSD DeserializeLLSDBinary(byte[] binaryData)
|
||||
{
|
||||
return DeserializeLLSDBinary(binaryData, false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deserializes binary LLSD
|
||||
/// </summary>
|
||||
/// <param name="binaryData">Serialized data</param>
|
||||
/// <param name="headerOptional">Treat LLSD binary header as optional</param>
|
||||
/// <returns>OSD containting deserialized data</returns>
|
||||
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
|
||||
/// <param name="stream">Stream to read the data from</param>
|
||||
/// <returns>OSD containting deserialized data</returns>
|
||||
public static OSD DeserializeLLSDBinary(Stream stream)
|
||||
{
|
||||
return DeserializeLLSDBinary(stream, false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deserializes binary LLSD
|
||||
/// </summary>
|
||||
/// <param name="stream">Stream to read the data from</param>
|
||||
/// <param name="headerOptional">Treat LLSD binary header as optional</param>
|
||||
/// <returns>OSD containting deserialized data</returns>
|
||||
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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user