BytesValues is not an easy class to extend. :( The issue here since you extend `copyShared` is that `currentValueHash` won't work anymore since its default impl returns the hash of `scratch`. So I think you should either:
 - also extend `currentValueHash`
 - or neither extend `currentValueHash` nor `copyShared`, and copy the value into `scratch` in `getValueByOrd` (no need to copy the term bytes, you just need to copy offset, length and the pointer to the byte[]).

I think the latter option is safer?