/** * Reads an <tt>int</tt> which spans the end of <tt>prevBlock</tt> and the start of this block. */ public int readIntLE(DataInputBlock prevBlock, int prevBlockAvailable) { byte[] buf = new byte[4]; readSpanning(prevBlock, prevBlockAvailable, buf); int b0 = buf[0] & 0xFF; int b1 = buf[1] & 0xFF; int b2 = buf[2] & 0xFF; int b3 = buf[3] & 0xFF; return (b3 << 24) + (b2 << 16) + (b1 << 8) + (b0 << 0); }
/** * Reads an <tt>int</tt> which spans the end of <tt>prevBlock</tt> and the start of this block. */ public int readIntLE(DataInputBlock prevBlock, int prevBlockAvailable) { byte[] buf = new byte[4]; readSpanning(prevBlock, prevBlockAvailable, buf); int b0 = buf[0] & 0xFF; int b1 = buf[1] & 0xFF; int b2 = buf[2] & 0xFF; int b3 = buf[3] & 0xFF; return (b3 << 24) + (b2 << 16) + (b1 << 8) + (b0 << 0); }
/** * Reads a <tt>long</tt> which spans the end of <tt>prevBlock</tt> and the start of this block. */ public long readLongLE(DataInputBlock prevBlock, int prevBlockAvailable) { byte[] buf = new byte[8]; readSpanning(prevBlock, prevBlockAvailable, buf); int b0 = buf[0] & 0xFF; int b1 = buf[1] & 0xFF; int b2 = buf[2] & 0xFF; int b3 = buf[3] & 0xFF; int b4 = buf[4] & 0xFF; int b5 = buf[5] & 0xFF; int b6 = buf[6] & 0xFF; int b7 = buf[7] & 0xFF; return (((long)b7 << 56) + ((long)b6 << 48) + ((long)b5 << 40) + ((long)b4 << 32) + ((long)b3 << 24) + (b2 << 16) + (b1 << 8) + (b0 << 0)); }
/** * Reads a <tt>long</tt> which spans the end of <tt>prevBlock</tt> and the start of this block. */ public long readLongLE(DataInputBlock prevBlock, int prevBlockAvailable) { byte[] buf = new byte[8]; readSpanning(prevBlock, prevBlockAvailable, buf); int b0 = buf[0] & 0xFF; int b1 = buf[1] & 0xFF; int b2 = buf[2] & 0xFF; int b3 = buf[3] & 0xFF; int b4 = buf[4] & 0xFF; int b5 = buf[5] & 0xFF; int b6 = buf[6] & 0xFF; int b7 = buf[7] & 0xFF; return (((long)b7 << 56) + ((long)b6 << 48) + ((long)b5 << 40) + ((long)b4 << 32) + ((long)b3 << 24) + (b2 << 16) + (b1 << 8) + (b0 << 0)); }