Пример #1
0
 /** @return Reads JDWP representation and returns new instance. */
 public static ValueImpl readWithoutTag(MirrorImpl target, int type, DataInputStream in)
     throws IOException {
   VirtualMachineImpl vmImpl = target.virtualMachineImpl();
   // See also ArrayReference Impl.
   switch (type) {
     case ArrayReferenceImpl.tag:
       return ArrayReferenceImpl.read(target, in);
     case ClassLoaderReferenceImpl.tag:
       return ClassLoaderReferenceImpl.read(target, in);
     case ClassObjectReferenceImpl.tag:
       return ClassObjectReferenceImpl.read(target, in);
     case StringReferenceImpl.tag:
       return StringReferenceImpl.read(target, in);
     case ObjectReferenceImpl.tag:
       return ObjectReferenceImpl.readObjectRefWithoutTag(target, in);
     case ThreadGroupReferenceImpl.tag:
       return ThreadGroupReferenceImpl.read(target, in);
     case ThreadReferenceImpl.tag:
       return ThreadReferenceImpl.read(target, in);
     case BooleanValueImpl.tag:
       return BooleanValueImpl.read(target, in);
     case ByteValueImpl.tag:
       return ByteValueImpl.read(target, in);
     case CharValueImpl.tag:
       return CharValueImpl.read(target, in);
     case DoubleValueImpl.tag:
       return DoubleValueImpl.read(target, in);
     case FloatValueImpl.tag:
       return FloatValueImpl.read(target, in);
     case IntegerValueImpl.tag:
       return IntegerValueImpl.read(target, in);
     case LongValueImpl.tag:
       return LongValueImpl.read(target, in);
     case ShortValueImpl.tag:
       return ShortValueImpl.read(target, in);
     case VoidValueImpl.tag:
       return new VoidValueImpl(vmImpl);
     case 0:
       return null;
     default:
       throw new InternalException(JDIMessages.ValueImpl_Invalid_Value_tag_encountered___1 + type);
   }
 }
Пример #2
0
 /** Writes null value without value tag. */
 public static void writeNull(MirrorImpl target, DataOutputStream out) throws IOException {
   JdwpObjectID nullID = new JdwpObjectID(target.virtualMachineImpl());
   nullID.write(out);
   if (target.fVerboseWriter != null)
     target.fVerboseWriter.println("objectReference", nullID.value()); // $NON-NLS-1$
 }