Пример #1
0
  /**
   * Calculates the text offset and writes the text value.
   *
   * @param value value to be inlined
   * @param text text/attribute flag
   * @return inline value or text position
   * @throws IOException I/O exception
   */
  private long textOff(final byte[] value, final boolean text) throws IOException {
    // inline integer values...
    final long v = Token.toSimpleInt(value);
    if (v != Integer.MIN_VALUE) return v | IO.OFFNUM;

    // store text
    final DataOutput store = text ? xout : vout;
    final long off = store.size();
    final byte[] val = COMP.get().pack(value);
    store.writeToken(val);
    return val == value ? off : off | IO.OFFCOMP;
  }
Пример #2
0
 @Override
 public double textDbl(final int pre, final boolean text) {
   return Token.toDouble(text(pre, text));
 }
Пример #3
0
 @Override
 public long textItr(final int pre, final boolean text) {
   return Token.toLong(text(pre, text));
 }