Beispiel #1
0
 /// <summary>
 /// Read an untagged value.
 /// </summary>
 private static void WriteValue(JdwpPacket.DataReaderWriter data, Jdwp.Tag tag, object obj)
 {
     switch (tag)
     {
         //case Jdwp.Tag.Array:
         //case Jdwp.Tag.Object:
         //case Jdwp.Tag.String:
         //case Jdwp.Tag.Thread:
         //case Jdwp.Tag.ThreadGroup:
         //case Jdwp.Tag.ClassLoader:
         //case Jdwp.Tag.ClassObject:
         //    return new ObjectId(readerWriter);
         case Jdwp.Tag.Byte:
             data.SetByte((byte)obj);
             break;
         case Jdwp.Tag.Short:
         case Jdwp.Tag.Char:
             data.SetInt16((int) obj);
             break;
         //case Jdwp.Tag.Float:
         //    readerWriter.GetFloat(); //?
         //    break;
         //case Jdwp.Tag.Double:
         //    return readerWriter.SetDouble(); //?
         case Jdwp.Tag.Int:
             data.SetInt((int)obj);
             break;
         case Jdwp.Tag.Long:
             data.SetLong((long) obj);
             break;
         case Jdwp.Tag.Boolean:
             data.SetBoolean((bool)obj);
             break;
         default:
             throw new ArgumentException("unsupported tag " + tag);
     }
 }