Package com.ngt.jopenmetaverse.shared.structureddata

Examples of com.ngt.jopenmetaverse.shared.structureddata.OSD


        }

        private static OSD ParseLLSDBinaryElement(InputStream stream) throws IOException, OSDException
        {
            SkipWhiteSpace(stream);
            OSD osd;

            int marker = stream.read();
            if (marker < 0)
                throw new OSDException("Binary LLSD parsing: Unexpected end of stream.");

            switch ((byte)marker)
            {
                case undefBinaryValue:
                    osd = new OSD();
                    break;
                case trueBinaryValue:
                    osd = OSD.FromBoolean(true);
                    break;
                case falseBinaryValue:
View Full Code Here


  {
    _Dead = false;

    // Create an EventQueueGet request
    OSDMap request = new OSDMap();
    request.put("ack", new OSD());
    request.put("done", OSD.FromBoolean(false));

    byte[] postData = XmlLLSDOSDParser.SerializeLLSDXmlBytes(request);

    _Request = HttpBaseClient.UploadDataAsync(_Address, null, "application/xml", postData, REQUEST_TIMEOUT
View Full Code Here

      BufferedReader in
      = new BufferedReader(new InputStreamReader(jsonStream));

      JsonElement obj = parser.parse(in);

      OSD ret = ParseLLSDJsonRoot(obj);

      return ret;
    }
    catch(Exception e)
    {
      e.printStackTrace();
      return new OSD();
    }
  }
View Full Code Here

  /// <param name="reader"></param>
  /// <returns></returns>

  private static OSD ParseLLSDJsonRoot(JsonElement obj) throws OSDException, URISyntaxException
  {   
    OSD ret = new OSD();

    if(!obj.isJsonArray())
      throw new OSDException("Json Top Element must be array");

    JsonArray rootArray = obj.getAsJsonArray();
View Full Code Here

  }


  private static OSD ParseLLSDJsonElement(JsonElement reader) throws OSDException, URISyntaxException
  {
    OSD ret = new OSD();
    if(reader.isJsonNull())
    {
      //System.out.println("Got Json Null...");
      return new OSD();
    }
    else if(reader.isJsonPrimitive())
    {
      //System.out.println("Got Json Primitive...");
      JsonPrimitive primitive = reader.getAsJsonPrimitive();
View Full Code Here

    internalRequestCompletedDelegate = new MethodDelegate<Void, HttpBaseRequestCompletedArg>()
        {
          public Void execute(HttpBaseRequestCompletedArg rcha) {
            _Request = rcha.getRequest();

            OSD result = null;

            if (rcha.getResponseData() != null)
            {
              try { result = OSDParser.Deserialize(rcha.getResponseData()); }
              catch (Exception ex) { rcha.setError(ex); }
View Full Code Here

         private final static char singleQuotesNotationMarker = '\'';

         public static OSD DeserializeLLSDNotation(String notationData) throws OSDException, IOException
         {
             StringReader reader = new StringReader(notationData);
             OSD osd = DeserializeLLSDNotation(reader);
             reader.close();
             return osd;
         }
View Full Code Here

             return osd;
         }

         public static OSD DeserializeLLSDNotation(StringReader reader) throws OSDException, IOException
         {
             OSD osd = DeserializeLLSDNotationElement(reader);
             return osd;
         }
View Full Code Here

         /// <returns></returns>
         private static OSD DeserializeLLSDNotationElement(StringReader reader) throws OSDException, IOException
         {
             int character = ReadAndSkipWhitespace(reader);
             if (character < 0)
                 return new OSD(); // server returned an empty file, so we're going to pass along a null LLSD object

//           System.out.print((char)character);
            
             OSD osd;
             int matching;
             switch ((char)character)
             {
                 case undefNotationValue:
                     osd = new OSD();
                     break;
                 case trueNotationValueOne:
                     osd = OSD.FromBoolean(true);
                     break;
                 case trueNotationValueTwo:
View Full Code Here

             int character;
             OSDMap osdMap = new OSDMap();
             while (((character = PeekAndSkipWhitespace(reader)) > 0) &&
                   ((char)character != mapEndNotationMarker))
             {
                 OSD osdKey = DeserializeLLSDNotationElement(reader);
                 if (osdKey.getType() != OSDType.String)
                     throw new OSDException("Notation LLSD parsing: Invalid key in map");
                 String key = osdKey.asString();

                 character = ReadAndSkipWhitespace(reader);
                 if ((char)character != keyNotationDelimiter)
                     throw new OSDException("Notation LLSD parsing: Unexpected end of stream in map.");
                 if ((char)character != keyNotationDelimiter)
View Full Code Here

TOP

Related Classes of com.ngt.jopenmetaverse.shared.structureddata.OSD

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.