add

fun add(bytes: BytesRef): Int

Adds a new BytesRef

Return

the id the given bytes are hashed if there was no mapping for the given bytes, otherwise (-(id)-1). This guarantees that the return value will always be >= 0 if the given bytes haven't been hashed before.

Parameters

bytes

the bytes to hash

Throws

if the given bytes are > 2 +