protected void writeReal(ImageOutputStream out,double value)throws IOException{
switch(type){
case RATIONAL:
val=out.getStreamPosition(); // address to rational
Rational ur=new Rational(value);
out.writeInt(ur.getNumerator());
out.writeInt(ur.getDenominator());
break;
case SRATIONAL:
val=out.getStreamPosition(); // address to rational
Rational sr=new Rational(value);
out.writeInt(sr.getNumerator());
out.writeInt(sr.getDenominator());
break;
case FLOAT:
val=Float.floatToIntBits((float)value); // size of float is 4 byte, hence we can save this in idf entry
break;
case DOUBLE: