I was wondering why the *BufferShallowCopy methods in CellUtil were marked
as @Deprecated and moved into PrivateCellUtil. I understand the general
motivation (hiding internal-only methods), but these methods don't expose
any internals or break abstractions, and they're helpful for handling Cell
data without having to copy it.

Alternatively, *BufferShallowCopy methods could be added to Cell, mirroring
Result.getValueAsByteBuffer, but it's an interface, so this would be messy
for implementing classes.

My specific reason for asking is that Protobuf's Java parsers have
parseFrom methods that accept either byte arrays, ByteStrings (a Protobuf
class), InputStreams, or ByteBuffers. Having a convenience method that
wraps the cell byte array makes it easy to parse the protobuf object
without having to copy bytes.

Reply via email to