示例#1
0
            /// <summary>
            /// Gets a byte from the current offset relative to the start of the data part.
            /// </summary>
            public byte GetByte()
            {
                var x = Offset;

                Offset += 1;
                return(packet.GetByte(x));
            }
示例#2
0
文件: Value.cs 项目: Xtremrules/dot42
 /// <summary>
 /// Read an untagged value.
 /// </summary>
 private static object ReadUntaggedValue(JdwpPacket.DataReaderWriter readerWriter, Jdwp.Tag tag)
 {
     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:
             return readerWriter.GetByte();
         case Jdwp.Tag.Char:
             return (char)readerWriter.GetInt16();
         case Jdwp.Tag.Float:
             return readerWriter.GetFloat();
         case Jdwp.Tag.Double:
             return readerWriter.GetDouble();
         case Jdwp.Tag.Int:
             return readerWriter.GetInt();
         case Jdwp.Tag.Long:
             return readerWriter.GetLong();
         case Jdwp.Tag.Short:
             return readerWriter.GetInt16();
         case Jdwp.Tag.Void:
             return null;
         case Jdwp.Tag.Boolean:
             return readerWriter.GetBoolean();
         default:
             throw new ArgumentException("Unknown tag " + (int)tag);
     }
 }
示例#3
0
文件: Value.cs 项目: Xtremrules/dot42
 /// <summary>
 /// Read a tagged value.
 /// </summary>
 public Value(JdwpPacket.DataReaderWriter readerWriter)
 {
     Tag = (Jdwp.Tag) readerWriter.GetByte();
     ValueObject = ReadUntaggedValue(readerWriter, Tag);
 }