/** * Takes 8 bytes and reverses them * * @param data * @param dest * @return * @throws TikaException */ private long unmarshalUint64(byte[] data, long dest) throws TikaException{ byte[] temp = new byte[8]; int i, j; if (8 > this.getDataRemained()) throw new TikaException("8 > this.getDataRemained()"); for (i = 8, j = 7; i > 0; i--) { temp[j--] = data[this.getCurrentPlace()]; this.setCurrentPlace(this.getCurrentPlace() + 1); } dest = new BigInteger(temp).longValue(); this.setDataRemained(this.getDataRemained() - 8); return dest; }
/** * Copies X bytes of source byte[] to the dest byte[] * * @param data * @param dest * @param count * @return */ private byte[] unmarshalUuid(byte[] data, byte[] dest, int count) { System.arraycopy(data, this.getCurrentPlace(), dest, 0, count); this.setCurrentPlace(this.getCurrentPlace() + count); this.setDataRemained(this.getDataRemained() - count); return dest; }
/** * Copies 4 first bytes of the byte[] * * @param data * @param chmItsfHeader * @param count * @throws TikaException */ private void unmarshalCharArray(byte[] data, ChmItsfHeader chmItsfHeader, int count) throws TikaException { ChmAssert.assertChmAccessorParameters(data, chmItsfHeader, count); System.arraycopy(data, 0, chmItsfHeader.signature, 0, count); this.setCurrentPlace(this.getCurrentPlace() + count); this.setDataRemained(this.getDataRemained() - count); }
private int unmarshalInt32(byte[] data, int dest) throws TikaException{ ChmAssert.assertByteArrayNotNull(data); if (4 > this.getDataRemained()) throw new TikaException("4 > dataLenght"); dest = (data[this.getCurrentPlace()] & 0xff) | (data[this.getCurrentPlace() + 1] & 0xff) << 8 | (data[this.getCurrentPlace() + 2] & 0xff) << 16 | (data[this.getCurrentPlace() + 3] & 0xff) << 24; this.setCurrentPlace(this.getCurrentPlace() + 4); this.setDataRemained(this.getDataRemained() - 4); return dest; }
private long unmarshalUInt32(byte[] data, long dest) throws TikaException{ ChmAssert.assertByteArrayNotNull(data); if (4 > getDataRemained()) throw new TikaException("4 > dataLenght"); dest = data[this.getCurrentPlace()] | data[this.getCurrentPlace() + 1] << 8 | data[this.getCurrentPlace() + 2] << 16 | data[this.getCurrentPlace() + 3] << 24; setDataRemained(this.getDataRemained() - 4); this.setCurrentPlace(this.getCurrentPlace() + 4); return dest; }
/** * Takes 8 bytes and reverses them * * @param data * @param dest * @return * @throws TikaException */ private long unmarshalUint64(byte[] data, long dest) throws TikaException{ byte[] temp = new byte[8]; int i, j; if (8 > this.getDataRemained()) throw new TikaException("8 > this.getDataRemained()"); for (i = 8, j = 7; i > 0; i--) { temp[j--] = data[this.getCurrentPlace()]; this.setCurrentPlace(this.getCurrentPlace() + 1); } dest = new BigInteger(temp).longValue(); this.setDataRemained(this.getDataRemained() - 8); return dest; }
/** * Takes 8 bytes and reverses them * * @param data * @param dest * @return * @throws TikaException */ private long unmarshalUint64(byte[] data, long dest) throws TikaException{ byte[] temp = new byte[8]; int i, j; if (8 > this.getDataRemained()) throw new TikaException("8 > this.getDataRemained()"); for (i = 8, j = 7; i > 0; i--) { temp[j--] = data[this.getCurrentPlace()]; this.setCurrentPlace(this.getCurrentPlace() + 1); } dest = new BigInteger(temp).longValue(); this.setDataRemained(this.getDataRemained() - 8); return dest; }
if (chmItsfHeader.getDataRemained() >= 0) chmItsfHeader.setDataOffset(chmItsfHeader.getDirOffset() + chmItsfHeader.getDirLen());
/** * Copies X bytes of source byte[] to the dest byte[] * * @param data * @param dest * @param count * @return */ private byte[] unmarshalUuid(byte[] data, byte[] dest, int count) { System.arraycopy(data, this.getCurrentPlace(), dest, 0, count); this.setCurrentPlace(this.getCurrentPlace() + count); this.setDataRemained(this.getDataRemained() - count); return dest; }
/** * Copies 4 first bytes of the byte[] * * @param data * @param chmItsfHeader * @param count * @throws TikaException */ private void unmarshalCharArray(byte[] data, ChmItsfHeader chmItsfHeader, int count) throws TikaException { ChmAssert.assertChmAccessorParameters(data, chmItsfHeader, count); System.arraycopy(data, 0, chmItsfHeader.signature, 0, count); this.setCurrentPlace(this.getCurrentPlace() + count); this.setDataRemained(this.getDataRemained() - count); }
/** * Copies X bytes of source byte[] to the dest byte[] * * @param data * @param dest * @param count * @return */ private byte[] unmarshalUuid(byte[] data, byte[] dest, int count) { System.arraycopy(data, this.getCurrentPlace(), dest, 0, count); this.setCurrentPlace(this.getCurrentPlace() + count); this.setDataRemained(this.getDataRemained() - count); return dest; }
/** * Copies 4 first bytes of the byte[] * * @param data * @param chmItsfHeader * @param count * @throws TikaException */ private void unmarshalCharArray(byte[] data, ChmItsfHeader chmItsfHeader, int count) throws TikaException { ChmAssert.assertChmAccessorParameters(data, chmItsfHeader, count); System.arraycopy(data, 0, chmItsfHeader.signature, 0, count); this.setCurrentPlace(this.getCurrentPlace() + count); this.setDataRemained(this.getDataRemained() - count); }
private long unmarshalUInt32(byte[] data, long dest) throws TikaException{ ChmAssert.assertByteArrayNotNull(data); if (4 > getDataRemained()) throw new TikaException("4 > dataLenght"); dest = data[this.getCurrentPlace()] | data[this.getCurrentPlace() + 1] << 8 | data[this.getCurrentPlace() + 2] << 16 | data[this.getCurrentPlace() + 3] << 24; setDataRemained(this.getDataRemained() - 4); this.setCurrentPlace(this.getCurrentPlace() + 4); return dest; }
private int unmarshalInt32(byte[] data, int dest) throws TikaException{ ChmAssert.assertByteArrayNotNull(data); if (4 > this.getDataRemained()) throw new TikaException("4 > dataLenght"); dest = (data[this.getCurrentPlace()] & 0xff) | (data[this.getCurrentPlace() + 1] & 0xff) << 8 | (data[this.getCurrentPlace() + 2] & 0xff) << 16 | (data[this.getCurrentPlace() + 3] & 0xff) << 24; this.setCurrentPlace(this.getCurrentPlace() + 4); this.setDataRemained(this.getDataRemained() - 4); return dest; }
private int unmarshalInt32(byte[] data, int dest) throws TikaException{ ChmAssert.assertByteArrayNotNull(data); if (4 > this.getDataRemained()) throw new TikaException("4 > dataLenght"); dest = (data[this.getCurrentPlace()] & 0xff) | (data[this.getCurrentPlace() + 1] & 0xff) << 8 | (data[this.getCurrentPlace() + 2] & 0xff) << 16 | (data[this.getCurrentPlace() + 3] & 0xff) << 24; this.setCurrentPlace(this.getCurrentPlace() + 4); this.setDataRemained(this.getDataRemained() - 4); return dest; }
private long unmarshalUInt32(byte[] data, long dest) throws TikaException{ ChmAssert.assertByteArrayNotNull(data); if (4 > getDataRemained()) throw new TikaException("4 > dataLenght"); dest = data[this.getCurrentPlace()] | data[this.getCurrentPlace() + 1] << 8 | data[this.getCurrentPlace() + 2] << 16 | data[this.getCurrentPlace() + 3] << 24; setDataRemained(this.getDataRemained() - 4); this.setCurrentPlace(this.getCurrentPlace() + 4); return dest; }
if (chmItsfHeader.getDataRemained() >= 0) chmItsfHeader.setDataOffset(chmItsfHeader.getDirOffset() + chmItsfHeader.getDirLen());
if (chmItsfHeader.getDataRemained() >= 0) chmItsfHeader.setDataOffset(chmItsfHeader.getDirOffset() + chmItsfHeader.getDirLen());