public void reset(int entryStartOffset,
                      ByteBuffer buffer) {
      this.entryStartOffset = entryStartOffset;
      this.buffer = buffer;

      if (isValid()) {
        byte firstByte = buffer.get(entryStartOffset);
        if ((firstByte & TINY_ENTRY_MASK) == 0) {//1 byte for (attributeId,size):
          attributeId = ((firstByte & TINY_ENTRY_ATTR_ID_MASK) >> TINY_ENTRY_SIZE_BITS);
          inlinedValueSizeOrDedicatedRecordId = (firstByte & TINY_ENTRY_SIZE_MASK);
          headerSize = SMALLEST_HEADER_SIZE;
        }
        else if ((firstByte & MEDIUM_ENTRY_MASK) == 0) {//2 bytes for (attributeId,size):
          assertMediumHeaderIsValid(buffer, entryStartOffset, firstByte);
          byte secondByte = buffer.get(entryStartOffset + 1);
          attributeId = firstByte & MEDIUM_ENTRY_MAX_ATTRIBUTE_ID;      //zero out first 2 bits
          inlinedValueSizeOrDedicatedRecordId = Byte.toUnsignedInt(secondByte);
          headerSize = MEDIUM_HEADER_SIZE;
        }
        else {//6 bytes for (attributeId, size):
          assertBigHeaderIsValid(buffer, entryStartOffset, firstByte);

          byte secondByte = buffer.get(entryStartOffset + 1);
          attributeId = ((firstByte & BIG_ENTRY_ATTR_ID_OF_FIRST_BYTE_MASK) << Byte.SIZE) | Byte.toUnsignedInt(secondByte);
          inlinedValueSizeOrDedicatedRecordId = buffer.getInt(entryStartOffset + 2);
          headerSize = BIG_HEADER_SIZE;
        }
      }
      else {//entry does not exist here (branch for to-be-created entry)
        attributeId = -1;
        inlinedValueSizeOrDedicatedRecordId = -1;
        headerSize = -1;
      }
    }
public void reset(int entryStartOffset,
                      ByteBuffer buffer)