FileDocCategorySizeDatePackage
UninterpretedAttribute.javaAPI DocJ2ME CLDC 1.12611Wed Feb 05 15:56:02 GMT 2003components

UninterpretedAttribute

public class UninterpretedAttribute extends Attribute

Fields Summary
public byte[]
data
Constructors Summary
public UninterpretedAttribute(UnicodeConstant name, int l, byte[] d)

    super( name, l );
    data = d;
    
Methods Summary
public static AttributefinishReadAttribute(java.io.DataInput i, UnicodeConstant name)

    int l;
    byte d[];

    l  = i.readInt();
    d = new byte[ l ];
    i.readFully( d );
    return new UninterpretedAttribute( name, l, d );
    
public intgetInt(int w)

    return    (  (int)data[w]   << 24 ) |
        (( (int)data[w+1] &0xff ) << 16 ) |
        (( (int)data[w+2] &0xff ) << 8 ) |
         ( (int)data[w+3] &0xff );
    
public intgetUnsignedShort(int w)

    return    (( (int)data[w] &0xff ) << 8 ) | ( (int)data[w+1] &0xff );
    
private voidputShort(int w, short v)

    data[w]   = (byte)(v>>>8);
    data[w+1] = (byte)v;
    
public static components.UninterpretedAttributereadAttribute(java.io.DataInput i, ConstantObject[] globals)

    UnicodeConstant name;
    int l;
    byte d[];

    name = (UnicodeConstant)globals[i.readUnsignedShort()];
    l  = i.readInt();
    d = new byte[ l ];
    i.readFully( d );
    return new UninterpretedAttribute( name, l, d );
    
public static Attribute[]readAttributes(java.io.DataInput i, ConstantObject[] t, boolean verbose)

    int nattr =  i.readUnsignedShort();
    if ( verbose ){
        System.out.println(Localizer.getString("uninterpretedattribute.reading_attributes", Integer.toString(nattr)));
    }
    if ( nattr == 0 ) return null;
    Attribute a[] = new Attribute[nattr];
    for ( int j = 0; j < nattr; j++ ){
        a[j] = readAttribute( i, t );
    }
    return a;
    
protected intwriteData(java.io.DataOutput o)

    int trueLength = 0;
    o.write( data, 0, data.length );
    return data.length;