/** {@inheritDoc} */ @Override protected short readShortFast() { long addr = ptr + pos; return BIG_ENDIAN ? GridUnsafe.getShortLE(addr) : GridUnsafe.getShort(addr); }
/** * @param ptr Pointer. * @return Short value. */ public short readShort(long ptr) { return GridUnsafe.getShort(ptr); }
/** {@inheritDoc} */ @Override protected short readShortPositioned0(int pos) { long off = GridUnsafe.BYTE_ARR_OFF + pos; return BIG_ENDIAN ? GridUnsafe.getShortLE(data, off) : GridUnsafe.getShort(data, off); }
/** * @param addr Address. * @param off Offset. * @return Value. */ public static short getShort(long addr, int off) { assert addr > 0 : addr; assert off >= 0; return GridUnsafe.getShort(addr + off); }
/** * @param ptr Pointer. * @param off Offset. * @return Value. */ public static short readShort(long ptr, int off) { long addr = ptr + off; return BIG_ENDIAN ? GridUnsafe.getShortLE(addr) : GridUnsafe.getShort(addr); }
/** {@inheritDoc} */ @Override public short readShort() { lastFinished = buf.remaining() >= 2; if (lastFinished) { int pos = buf.position(); buf.position(pos + 2); return GridUnsafe.getShort(heapArr, baseOff + pos); } else return 0; }
/** * @param arr Array. * @param off Offset. * @return Value. */ public static short readShort(byte[] arr, int off) { long pos = GridUnsafe.BYTE_ARR_OFF + off; return BIG_ENDIAN ? GridUnsafe.getShortLE(arr, pos) : GridUnsafe.getShort(arr, pos); }
/** {@inheritDoc} */ @Override public short getShort(int idx) { ensure(idx, 2); return GridUnsafe.getShort(ptr + idx); }
/** {@inheritDoc} */ @Override protected short readShortPositioned0(int pos) { long addr = ptr + pos; return BIG_ENDIAN ? GridUnsafe.getShortLE(addr) : GridUnsafe.getShort(addr); }
/** {@inheritDoc} */ @Override public short readShortPositioned(int pos) { int delta = pos + 2 - this.pos; if (delta > 0) ensureEnoughData(delta); return GridUnsafe.getShort(data + pos); }
/** {@inheritDoc} */ @Override protected short readShortFast() { long off = GridUnsafe.BYTE_ARR_OFF + pos; return BIG_ENDIAN ? GridUnsafe.getShortLE(data, off) : GridUnsafe.getShort(data, off); }
/** {@inheritDoc} */ @Override public short readShort() throws IOException { checkRange(2); short res = GridUnsafe.getShort(buf, BYTE_ARR_OFF + pos); pos += 2; return res; }
/** {@inheritDoc} */ @Override public short readShort() { lastFinished = buf.remaining() >= 2; if (lastFinished) { int pos = buf.position(); buf.position(pos + 2); long off = baseOff + pos; return BIG_ENDIAN ? GridUnsafe.getShortLE(heapArr, off) : GridUnsafe.getShort(heapArr, off); } else return 0; }
/** {@inheritDoc} */ @Override public short readShort() { ensureEnoughData(2); short res = GridUnsafe.getShort(data + pos); shift(2); return res; }
/** {@inheritDoc} */ @Override public short readShort() throws IOException { fromStream(2); long off = BYTE_ARR_OFF + offset(2); return BIG_ENDIAN ? GridUnsafe.getShortLE(buf, off) : GridUnsafe.getShort(buf, off); }
/** {@inheritDoc} */ @Override protected void printPage(long addr, int pageSize, GridStringBuilder sb) throws IgniteCheckedException { sb.a("TrackingPage [\n\tlastSnapshotTag=").a(getLastSnapshotTag(addr)) .a(",\n\tleftHalf={") .a("\n\t\tsize=").a(GridUnsafe.getShort(addr + SIZE_FIELD_OFFSET)) .a("\n\t\tdata={"); for (int i = 0; i < (countOfPageToTrack(pageSize) >> 3); i += 2) sb.appendHex(GridUnsafe.getShort(addr + BITMAP_OFFSET + i)); sb.a("}\n\t},\n\trightHalf={") .a("\n\t\tsize=").a(GridUnsafe.getShort(addr + BITMAP_OFFSET + (countOfPageToTrack(pageSize) >> 3))) .a("\n\t\tdata={"); for (int i = 0; i < (countOfPageToTrack(pageSize) >> 3); i += 2) sb.appendHex(GridUnsafe.getShort(addr + BITMAP_OFFSET + (countOfPageToTrack(pageSize) >> 3) + SIZE_FIELD_SIZE + i)); sb.a("}\n\t}\n]"); } }
/** {@inheritDoc} */ @Override protected short readShortPositioned0(int pos) { long addr = ptr + pos; return BIG_ENDIAN ? GridUnsafe.getShortLE(addr) : GridUnsafe.getShort(addr); }
/** * @param ptr Pointer. * @return Short value. */ public short readShort(long ptr) { return GridUnsafe.getShort(ptr); }
/** {@inheritDoc} */ @Override protected short readShortFast() { long off = GridUnsafe.BYTE_ARR_OFF + pos; return BIG_ENDIAN ? GridUnsafe.getShortLE(data, off) : GridUnsafe.getShort(data, off); }
/** {@inheritDoc} */ @Override public short readShort() throws IOException { fromStream(2); long off = BYTE_ARR_OFF + offset(2); return BIG_ENDIAN ? GridUnsafe.getShortLE(buf, off) : GridUnsafe.getShort(buf, off); }