add using into a few more places
parent
d7a9195078
commit
c7baee1638
|
@ -107,18 +107,18 @@ namespace OpenSim.Framework.Capabilities
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static byte[] LLSDSerialize(object obj)
|
public static byte[] LLSDSerialize(object obj)
|
||||||
{
|
{
|
||||||
StringWriter sw = new StringWriter();
|
using(StringWriter sw = new StringWriter())
|
||||||
XmlTextWriter writer = new XmlTextWriter(sw);
|
using(XmlTextWriter writer = new XmlTextWriter(sw))
|
||||||
|
{
|
||||||
writer.Formatting = Formatting.None;
|
writer.Formatting = Formatting.None;
|
||||||
|
|
||||||
writer.WriteStartElement(String.Empty, "llsd", String.Empty);
|
writer.WriteStartElement(String.Empty, "llsd", String.Empty);
|
||||||
LLSDWriteOne(writer, obj);
|
LLSDWriteOne(writer, obj);
|
||||||
writer.WriteEndElement();
|
writer.WriteEndElement();
|
||||||
|
writer.Flush();
|
||||||
writer.Close();
|
|
||||||
|
|
||||||
return Util.UTF8.GetBytes(sw.ToString());
|
return Util.UTF8.GetBytes(sw.ToString());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
|
|
|
@ -41,31 +41,33 @@ namespace OpenSim.Framework.Capabilities
|
||||||
|
|
||||||
public static string SerialiseLLSDReply(object obj)
|
public static string SerialiseLLSDReply(object obj)
|
||||||
{
|
{
|
||||||
StringWriter sw = new StringWriter();
|
using(StringWriter sw = new StringWriter())
|
||||||
XmlTextWriter writer = new XmlTextWriter(sw);
|
using(XmlTextWriter writer = new XmlTextWriter(sw))
|
||||||
|
{
|
||||||
writer.Formatting = Formatting.None;
|
writer.Formatting = Formatting.None;
|
||||||
writer.WriteStartElement(String.Empty, "llsd", String.Empty);
|
writer.WriteStartElement(String.Empty, "llsd", String.Empty);
|
||||||
SerializeOSDType(writer, obj);
|
SerializeOSDType(writer, obj);
|
||||||
writer.WriteEndElement();
|
writer.WriteEndElement();
|
||||||
writer.Close();
|
writer.Flush();
|
||||||
|
|
||||||
//m_log.DebugFormat("[LLSD Helpers]: Generated serialized LLSD reply {0}", sw.ToString());
|
//m_log.DebugFormat("[LLSD Helpers]: Generated serialized LLSD reply {0}", sw.ToString());
|
||||||
|
|
||||||
return sw.ToString();
|
return sw.ToString();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static string SerialiseLLSDReplyNoHeader(object obj)
|
public static string SerialiseLLSDReplyNoHeader(object obj)
|
||||||
{
|
{
|
||||||
StringWriter sw = new StringWriter();
|
using(StringWriter sw = new StringWriter())
|
||||||
XmlTextWriter writer = new XmlTextWriter(sw);
|
using(XmlTextWriter writer = new XmlTextWriter(sw))
|
||||||
|
{
|
||||||
writer.Formatting = Formatting.None;
|
writer.Formatting = Formatting.None;
|
||||||
SerializeOSDType(writer, obj);
|
SerializeOSDType(writer, obj);
|
||||||
writer.Close();
|
writer.Flush();
|
||||||
|
|
||||||
//m_log.DebugFormat("[LLSD Helpers]: Generated serialized LLSD reply {0}", sw.ToString());
|
//m_log.DebugFormat("[LLSD Helpers]: Generated serialized LLSD reply {0}", sw.ToString());
|
||||||
|
|
||||||
return sw.ToString();
|
return sw.ToString();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static void SerializeOSDType(XmlTextWriter writer, object obj)
|
private static void SerializeOSDType(XmlTextWriter writer, object obj)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue