int getSerializedLength(TinyStoredObject dataAsAddress) {
    final long ohAddress = dataAsAddress.getAddress();

    if ((ohAddress & ENCODED_BIT) != 0) {
      boolean isLong = (ohAddress & LONG_BIT) != 0;
      if (isLong) {
        return 9;
      }
      return (int) ((ohAddress & SIZE_MASK) >> SIZE_SHIFT);
    }

    return 0;
  }
This method may release the object stored at ohAddress if the result needs to be decompressed
and the decompress parameter is true. This decompressed result will be on the heap.

@param ohAddress OFF_HEAP_ADDRESS
@param decompress true if off-heap value should be decompressed before returning
@param context used for decompression
@return OFF_HEAP_OBJECT (sometimes)
geode-core/src/main/java/org/apache/geode/internal/offheap/OffHeapRegionEntryHelperInstance.java