Exemplo n.º 1
0
 public float getR4(int id) {
   Property p = (Property) properties.get(new Integer(id));
   try {
     int offset = p.getOffset();
     stream.seek(offset);
     return stream.readFloatLE();
   } catch (IOException e) {
     ImagingListenerProxy.errorOccurred(JaiI18N.getString("PropertySet6"), e, this, false);
     //            e.printStackTrace();
     return -1.0F;
   }
 }
Exemplo n.º 2
0
  public int getUI1(int id) {
    Property p = (Property) properties.get(new Integer(id));
    try {
      int offset = p.getOffset();
      stream.seek(offset);
      return stream.readUnsignedByte();
    } catch (IOException e) {
      ImagingListenerProxy.errorOccurred(JaiI18N.getString("PropertySet1"), e, this, false);
      //            e.printStackTrace();
    }

    return -1;
  }
Exemplo n.º 3
0
  public long getUI4(int id, long defaultValue) {
    Property p = (Property) properties.get(new Integer(id));
    if (p == null) {
      return defaultValue;
    }

    try {
      int offset = p.getOffset();
      stream.seek(offset);
      return stream.readUnsignedIntLE();
    } catch (IOException e) {
      ImagingListenerProxy.errorOccurred(JaiI18N.getString("PropertySet4"), e, this, false);
      //            e.printStackTrace();
    }

    return -1;
  }
Exemplo n.º 4
0
  public byte[] getBlob(int id) {
    Property p = (Property) properties.get(new Integer(id));
    try {
      int offset = p.getOffset();
      stream.seek(offset);
      int length = stream.readIntLE();

      byte[] buf = new byte[length];
      stream.seek(offset + 4);
      stream.readFully(buf);

      return buf;
    } catch (IOException e) {
      ImagingListenerProxy.errorOccurred(JaiI18N.getString("PropertySet7"), e, this, false);
      //            e.printStackTrace();
      return null;
    }
  }
Exemplo n.º 5
0
  public String getLPWSTR(int id) {
    Property p = (Property) properties.get(new Integer(id));
    try {
      int offset = p.getOffset();

      stream.seek(offset);
      int length = stream.readIntLE();
      StringBuffer sb = new StringBuffer(length);
      for (int i = 0; i < length; i++) {
        sb.append(stream.readCharLE());
      }

      return sb.toString();
    } catch (IOException e) {
      ImagingListenerProxy.errorOccurred(JaiI18N.getString("PropertySet5"), e, this, false);
      //            e.printStackTrace();
      return null;
    }
  }