TMI-TIFF: Fixed several bugs in the LittleEndianDataInputStream needed for proper TIFF output (should affect other things as well...)

This commit is contained in:
Harald Kuhr
2013-02-15 12:55:37 +01:00
parent ed6223fcab
commit d8867736b7
4 changed files with 978 additions and 66 deletions

View File

@@ -158,7 +158,7 @@ public class LittleEndianDataInputStream extends FilterInputStream implements Da
throw new EOFException();
}
return (short) (((byte2 << 24) >>> 16) + (byte1 << 24) >>> 24);
return (short) (((byte2 << 24) >>> 16) | (byte1 << 24) >>> 24);
}
/**
@@ -198,7 +198,7 @@ public class LittleEndianDataInputStream extends FilterInputStream implements Da
throw new EOFException();
}
return (char) (((byte2 << 24) >>> 16) + ((byte1 << 24) >>> 24));
return (char) (((byte2 << 24) >>> 16) | ((byte1 << 24) >>> 24));
}
@@ -221,8 +221,8 @@ public class LittleEndianDataInputStream extends FilterInputStream implements Da
throw new EOFException();
}
return (byte4 << 24) + ((byte3 << 24) >>> 8)
+ ((byte2 << 24) >>> 16) + ((byte1 << 24) >>> 24);
return (byte4 << 24) | ((byte3 << 24) >>> 8)
| ((byte2 << 24) >>> 16) | ((byte1 << 24) >>> 24);
}
/**
@@ -248,10 +248,10 @@ public class LittleEndianDataInputStream extends FilterInputStream implements Da
throw new EOFException();
}
return (byte8 << 56) + ((byte7 << 56) >>> 8)
+ ((byte6 << 56) >>> 16) + ((byte5 << 56) >>> 24)
+ ((byte4 << 56) >>> 32) + ((byte3 << 56) >>> 40)
+ ((byte2 << 56) >>> 48) + ((byte1 << 56) >>> 56);
return (byte8 << 56) | ((byte7 << 56) >>> 8)
| ((byte6 << 56) >>> 16) | ((byte5 << 56) >>> 24)
| ((byte4 << 56) >>> 32) | ((byte3 << 56) >>> 40)
| ((byte2 << 56) >>> 48) | ((byte1 << 56) >>> 56);
}
/**