OpenSim/Framework/Util.cs
/// <summary>
/// Produces an OSDMap from its string representation on a stream
/// </summary>
/// <param name="data">The stream</param>
/// <param name="length">The size of the data on the stream</param>
/// <returns>The OSDMap or an exception</returns>
Produces an OSDMap from its string representation on a stream
Produces an OSDMap from its string representation on a stream
public static OSDMap GetOSDMap(Stream stream, int length)
        {
            byte[] data = new byte[length];
            stream.Read(data, 0, length);
            string strdata = Util.UTF8.GetString(data);
            OSDMap args = null;
            OSD buffer;
            buffer = OSDParser.DeserializeJson(strdata);
            if (buffer.Type == OSDType.Map)
            {
                args = (OSDMap)buffer;
                return args;
            }
            return null;
        }
public static OSDMap GetOSDMap ( Stream stream , int length ) { byte [ ] data = new byte [ length ] ; stream . Read ( data , 0 , length ) ; string strdata = Util . UTF8 . GetString ( data ) ; OSDMap args = null ; OSD buffer ; buffer = OSDParser . DeserializeJson ( strdata ) ; if ( buffer . Type == OSDType . Map ) { args = ( OSDMap ) buffer ; return args ; } return null ; }
Produces an OSDMap from its string representation on a stream
Produces an OSDMap from its string representation on a stream
The OSDMap or an exception
The OSDMap or an exception
stream
Stream
length
int
The size of the data on the stream
The size of the data on the stream
data
None