public long getAsLong ( int index ) { switch ( type ) { case TIFF_BYTE : case TIFF_UNDEFINED : return ( ( byte [ ] ) data ) [ index ] & 0xff ; case TIFF_SBYTE : return ( ( byte [ ] ) data ) [ index ] ; case TIFF_SHORT : return ( ( char [ ] ) data ) [ index ] & 0xffff ; case TIFF_SSHORT : return ( ( short [ ] ) data ) [ index ] ; case TIFF_SLONG : return ( ( int [ ] ) data ) [ index ] ; case TIFF_LONG : return ( ( long [ ] ) data ) [ index ] ; default : throw new ClassCastException ( ) ; } }
Returns data in TIFF_BYTE TIFF_SBYTE TIFF_UNDEFINED TIFF_SHORT TIFF_SSHORT TIFF_SLONG or TIFF_LONG format as a long .