/** {@inheritDoc} */ @Override public boolean hasSchema() { short flags = BinaryPrimitives.readShort(arr, start + GridBinaryMarshaller.FLAGS_POS); return BinaryUtils.hasSchema(flags); }
/** {@inheritDoc} */ @Override public boolean hasSchema() { short flags = BinaryPrimitives.readShort(ptr, start + GridBinaryMarshaller.FLAGS_POS); return BinaryUtils.hasSchema(flags); }
/** {@inheritDoc} */ @Override public int footerStartOffset() { short flags = BinaryPrimitives.readShort(ptr, start + GridBinaryMarshaller.FLAGS_POS); if (!BinaryUtils.hasSchema(flags)) return start + length(); return start + BinaryPrimitives.readInt(ptr, start + GridBinaryMarshaller.SCHEMA_OR_RAW_OFF_POS); }
/** {@inheritDoc} */ @Override public int footerStartOffset() { short flags = BinaryPrimitives.readShort(arr, start + GridBinaryMarshaller.FLAGS_POS); if (!BinaryUtils.hasSchema(flags)) return start + length(); return start + BinaryPrimitives.readInt(arr, start + GridBinaryMarshaller.SCHEMA_OR_RAW_OFF_POS); }
/** * Get footer start of the object. * * @param in Input stream. * @param start Object start position inside the stream. * @return Footer start. */ public static int footerStartRelative(BinaryPositionReadable in, int start) { short flags = in.readShortPositioned(start + GridBinaryMarshaller.FLAGS_POS); if (hasSchema(flags)) // Schema exists, use offset. return in.readIntPositioned(start + GridBinaryMarshaller.SCHEMA_OR_RAW_OFF_POS); else // No schema, footer start equals to object end. return length(in, start); }
/** * Get object's footer. * * @param in Input stream. * @param start Start position. * @return Footer. */ public static IgniteBiTuple<Integer, Integer> footerAbsolute(BinaryPositionReadable in, int start) { short flags = in.readShortPositioned(start + GridBinaryMarshaller.FLAGS_POS); int footerEnd = length(in, start); if (hasSchema(flags)) { // Schema exists. int footerStart = in.readIntPositioned(start + GridBinaryMarshaller.SCHEMA_OR_RAW_OFF_POS); if (hasRaw(flags)) footerEnd -= 4; assert footerStart <= footerEnd; return F.t(start + footerStart, start + footerEnd); } else // No schema. return F.t(start + footerEnd, start + footerEnd); }
/** * Get relative raw offset of the object. * * @param in Input stream. * @param start Object start position inside the stream. * @return Raw offset. */ public static int rawOffsetRelative(BinaryPositionReadable in, int start) { short flags = in.readShortPositioned(start + GridBinaryMarshaller.FLAGS_POS); int len = length(in, start); if (hasSchema(flags)) { // Schema exists. if (hasRaw(flags)) // Raw offset is set, it is at the very end of the object. return in.readIntPositioned(start + len - 4); else // Raw offset is not set, so just return schema offset. return in.readIntPositioned(start + GridBinaryMarshaller.SCHEMA_OR_RAW_OFF_POS); } else // No schema, raw offset is located on schema offset position. return in.readIntPositioned(start + GridBinaryMarshaller.SCHEMA_OR_RAW_OFF_POS); }
if (reader != null && BinaryUtils.hasSchema(flags)) { BinarySchema schema = reader.schema();
/** {@inheritDoc} */ @Override public boolean hasSchema() { short flags = BinaryPrimitives.readShort(arr, start + GridBinaryMarshaller.FLAGS_POS); return BinaryUtils.hasSchema(flags); }
/** {@inheritDoc} */ @Override public boolean hasSchema() { short flags = BinaryPrimitives.readShort(ptr, start + GridBinaryMarshaller.FLAGS_POS); return BinaryUtils.hasSchema(flags); }
/** {@inheritDoc} */ @Override public int footerStartOffset() { short flags = BinaryPrimitives.readShort(ptr, start + GridBinaryMarshaller.FLAGS_POS); if (!BinaryUtils.hasSchema(flags)) return start + length(); return start + BinaryPrimitives.readInt(ptr, start + GridBinaryMarshaller.SCHEMA_OR_RAW_OFF_POS); }
/** {@inheritDoc} */ @Override public int footerStartOffset() { short flags = BinaryPrimitives.readShort(arr, start + GridBinaryMarshaller.FLAGS_POS); if (!BinaryUtils.hasSchema(flags)) return start + length(); return start + BinaryPrimitives.readInt(arr, start + GridBinaryMarshaller.SCHEMA_OR_RAW_OFF_POS); }
/** * Get footer start of the object. * * @param in Input stream. * @param start Object start position inside the stream. * @return Footer start. */ public static int footerStartRelative(BinaryPositionReadable in, int start) { short flags = in.readShortPositioned(start + GridBinaryMarshaller.FLAGS_POS); if (hasSchema(flags)) // Schema exists, use offset. return in.readIntPositioned(start + GridBinaryMarshaller.SCHEMA_OR_RAW_OFF_POS); else // No schema, footer start equals to object end. return length(in, start); }
/** * Get relative raw offset of the object. * * @param in Input stream. * @param start Object start position inside the stream. * @return Raw offset. */ public static int rawOffsetRelative(BinaryPositionReadable in, int start) { short flags = in.readShortPositioned(start + GridBinaryMarshaller.FLAGS_POS); int len = length(in, start); if (hasSchema(flags)) { // Schema exists. if (hasRaw(flags)) // Raw offset is set, it is at the very end of the object. return in.readIntPositioned(start + len - 4); else // Raw offset is not set, so just return schema offset. return in.readIntPositioned(start + GridBinaryMarshaller.SCHEMA_OR_RAW_OFF_POS); } else // No schema, raw offset is located on schema offset position. return in.readIntPositioned(start + GridBinaryMarshaller.SCHEMA_OR_RAW_OFF_POS); }
/** * Get object's footer. * * @param in Input stream. * @param start Start position. * @return Footer. */ public static IgniteBiTuple<Integer, Integer> footerAbsolute(BinaryPositionReadable in, int start) { short flags = in.readShortPositioned(start + GridBinaryMarshaller.FLAGS_POS); int footerEnd = length(in, start); if (hasSchema(flags)) { // Schema exists. int footerStart = in.readIntPositioned(start + GridBinaryMarshaller.SCHEMA_OR_RAW_OFF_POS); if (hasRaw(flags)) footerEnd -= 4; assert footerStart <= footerEnd; return F.t(start + footerStart, start + footerEnd); } else // No schema. return F.t(start + footerEnd, start + footerEnd); }
if (reader != null && BinaryUtils.hasSchema(flags)) { BinarySchema schema = reader.schema();