Package util

Examples of util.DataFormatException


    public void write( DataOutput o ) throws IOException{
  o.writeByte( tag );
  if ( resolved ){
      o.writeShort( str.index );
  } else {
      throw new DataFormatException("unresolved StringConstant");
      //o.writeShort( strIndex );
  }
    }
View Full Code Here


    case opc_iinc:
        i += 6;
        break;

    default:
        throw new DataFormatException( parent.className + "." +
      name.string + ": unknown wide " +
      "instruction: " + code[i+1] );
    }
    break;
      case opc_ldc:
View Full Code Here

      for (int i = 0; i < n; i++){
    int j = list[i]+1;
    if ( j <= 0 ) continue;
    ConstantObject c = table[ (int)code[j]&0xff ];
    if ( c.shared )
        throw new DataFormatException("code reference to shared constant");
    int v = c.index;
    if ( v < 0 )
        throw new DataFormatException("code reference to deleted constant at "+qualifiedName()+"+"+Integer.toHexString(j));
    if ( v > 255 )
        throw new DataFormatException("ldc subscript out of range at "+qualifiedName()+"+"+Integer.toHexString(j));
    code[j] = (byte)v;
      }
  }
  if ( wideConstantRefInstructions != null ){
      int list[] = wideConstantRefInstructions;
      int n = list.length;
      for (int i = 0; i < n; i++){
    int j = list[i]+1;
    if ( j <= 0 ) continue;
    ConstantObject c = table[ getUnsignedShort(j) ];
    if ( c.shared )
        throw new DataFormatException("code reference to shared constant at "+qualifiedName()+"+"+Integer.toHexString(j));
    int v = c.index;
    if ( v < 0 )
        throw new DataFormatException("code reference to deleted constant at "+qualifiedName()+"+"+Integer.toHexString(j));
    putShort( j, (short)v );
      }
  }
    }
View Full Code Here

    // Write out reference to the ClassClass data structure
    public void write( DataOutput o ) throws IOException{
  o.writeByte( tag );
  if ( ! resolved )
      throw new DataFormatException("unresolved ClassConstant");
  int x = name.index;
  if ( x == 0 )
      throw new DataFormatException("0 name index for "+name.string);
  o.writeShort( x );
    }
View Full Code Here

  o.writeByte( tag );
  if ( resolved ){
      o.writeShort( name.index );
      o.writeShort( type.index );
  } else {
      throw new DataFormatException("unresolved NameAndTypeConstant");
      //o.writeShort( nameIndex );
      //o.writeShort( typeIndex );
  }
    }
View Full Code Here

  case Const.CONSTANT_METHOD:
      return MethodConstant.read( tag, i );
  case Const.CONSTANT_INTERFACEMETHOD:
      return InterfaceConstant.read( tag, i );
  default:
      throw new DataFormatException("Format error (constant tag "+tag+" )");
  }
    }
View Full Code Here

TOP

Related Classes of util.DataFormatException

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.