long crccmp = Long.valueOf(new String(data, 4, 8), 16).longValue();
long crccmp; try { crccmp = Long.valueOf(new String(data, 4, 8, "UTF-8"), 16).longValue(); } catch (UnsupportedEncodingException e) { crccmp = Long.valueOf(new String(data, 4, 8), 16).longValue(); }
	private int getStreamType(InputStream is, Checksum crc) throws IOException {		boolean markSupported = is.markSupported();		if (markSupported)			is.mark(is.available());		try {			int len = is.available();			if (len < 16) {				if (crc != null) {					byte data[] = new byte[16];					int num = is.read(data);					if (num > 0)						crc.update(data, 0, num);				}				return FILETYPE_NOSIGNATURE;			}			len -= 16;			int pos = 0;			byte data[] = new byte[BUF_SIZE];			while (pos < len) {				int read = data.length;				if (pos + read > len)					read = len - pos;				int num = is.read(data, 0, read);				if (num == -1) {					throw new IOException("Unable to read entire file."); //$NON-NLS-1$				}				crc.update(data, 0, num);				pos += num;			}			int num = is.read(data); // read last 16-byte signature			if (num != 16) {				throw new IOException("Unable to read entire file."); //$NON-NLS-1$			}			int i, j;			for (i = 0; i < 4; i++)				if (identifier1[i] != data[i]) {					crc.update(data, 0, 16); // update crc w/ sig bytes					return FILETYPE_NOSIGNATURE;				}			for (i = 0, j = 12; i < 4; i++, j++)				if (identifier2[i] != data[j]) {					crc.update(data, 0, 16); // update crc w/ sig bytes					return FILETYPE_NOSIGNATURE;				}			long crccmp = Long.valueOf(new String(data, 4, 8), 16).longValue();			if (crccmp == crc.getValue()) {				return FILETYPE_VALID;			}			// do not update CRC			return FILETYPE_CORRUPT;		} finally {			if (markSupported)				is.reset();		}	}