/** * get a long value from a byte array * * @param data * the byte array * @return the long (64-bit) value */ public static long getLong( byte[] data ) { return getLong( data, 0 ); }
public long getD4() { byte[] result = new byte[Long.SIZE/Byte.SIZE]; long l = _d4; for (int i = result.length-1; i >= 0; i--) { result[i] = (byte)(l & 0xFF); l >>= 8; } return LittleEndian.getLong(result, 0); }
/** * set the value from its offset into an array of bytes * * @param data the byte array from which the value is to be read * * @exception ArrayIndexOutOfBoundsException if the offset is out * of range */ public void readFromBytes(final byte [] data) throws ArrayIndexOutOfBoundsException { _value = LittleEndian.getLong(data, _offset); }
/** * get a double value from a byte array, reads it in little endian format * then converts the resulting revolting IEEE 754 (curse them) floating * point number to a happy java double * * @param data * the byte array * @return the double (64-bit) value */ public static double getDouble( byte[] data ) { return Double.longBitsToDouble( getLong( data, 0 ) ); }
/** * get a double value from a byte array, reads it in little endian format * then converts the resulting revolting IEEE 754 (curse them) floating * point number to a happy java double * * @param data * the byte array * @param offset * a starting offset into the byte array * @return the double (64-bit) value */ public static double getDouble( byte[] data, int offset ) { return Double.longBitsToDouble( getLong( data, offset ) ); }
@Override public long readLong() { byte buf[] = new byte[LittleEndianConsts.LONG_SIZE]; try { checkEOF(read(buf), LittleEndianConsts.LONG_SIZE); } catch (IOException e) { throw new RuntimeException(e); } return LittleEndian.getLong(buf); }
@Override public long readLong() { checkAvaliable(LONG_SIZE); byte[] data = new byte[LONG_SIZE]; readFully(data, 0, LONG_SIZE); return LittleEndian.getLong(data, 0); }
@Override public long readLong() { if (shouldSkipEncryptionOnCurrentRecord) { readPlain(buffer, 0, LittleEndianConsts.LONG_SIZE); return LittleEndian.getLong(buffer); } else { return ccis.readLong(); } }
@Override public long readLong() { final int size = LittleEndianConsts.LONG_SIZE; checkPosition(size); long le = LittleEndian.getLong(buf, pos); long skipped = super.skip(size); assert skipped == size : "Buffer overrun"; return le; }
String act = HexDump.longToHex(LittleEndian.getLong(data, 0)); throw new NotOLE2FileException( "Invalid header signature; read " + act + ", expected " + exp +
/** * get a long value from a byte array * * @param data * the byte array * @return the long (64-bit) value */ public static long getLong( byte[] data ) { return getLong( data, 0 ); }
/** * get a long value from a byte array * * @param data * the byte array * @return the long (64-bit) value */ public static long getLong( byte[] data ) { return getLong( data, 0 ); }
@Override public BigInteger getValue() { long unshifted = LittleEndian.getLong(data); return BigInteger.valueOf(unshifted).divide(SHIFT); }
/** * Constructs a single new date attribute from the id, type, * and the contents of the stream */ protected MAPIDateAttribute(MAPIProperty property, int type, byte[] data) { super(property, type, data); // The value is a 64 bit Windows Filetime this.data = Util.filetimeToDate( LittleEndian.getLong(data, 0) ); }
/** * Constructs a single new date attribute from the id, type, * and the contents of the stream */ protected MAPIDateAttribute(MAPIProperty property, int type, byte[] data) { super(property, type, data); // The value is a 64 bit Windows Filetime this.data = Filetime.filetimeToDate( LittleEndian.getLong(data, 0) ); }
@Override public long readLong() { byte buf[] = new byte[LittleEndianConsts.LONG_SIZE]; try { checkEOF(read(buf), LittleEndianConsts.LONG_SIZE); } catch (IOException e) { throw new RuntimeException(e); } return LittleEndian.getLong(buf); }
@Override public long readLong() { if (shouldSkipEncryptionOnCurrentRecord) { readPlain(buffer, 0, LittleEndianConsts.LONG_SIZE); return LittleEndian.getLong(buffer); } else { return ccis.readLong(); } }
@Override public long readLong() { final int size = LittleEndianConsts.LONG_SIZE; checkPosition(size); long le = LittleEndian.getLong(buf, pos); long skipped = super.skip(size); assert skipped == size : "Buffer overrun"; return le; }
@Override public long readLong() { checkAvaliable(LONG_SIZE); byte[] data = new byte[LONG_SIZE]; readFully(data, 0, LONG_SIZE); return LittleEndian.getLong(data, 0); }
GUID( byte[] data, int offset ) { _data1 = LittleEndian.getInt( data, offset + 0 ); _data2 = LittleEndian.getShort( data, offset + 4 ); _data3 = LittleEndian.getShort( data, offset + 6 ); _data4 = LittleEndian.getLong( data, offset + 8 ); } }