-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.
Description
It would be nice if flattened RPC calls had overloads that accepted standard Java types (i.e. a Java byte[] and/or ByteBuffer) instead of always requiring a protobuf ByteString. The latter ends up leaking an implementation detail to callers.
As an example, in Cloud KMS we currently have:
String textRaw = "The quick brown fox jumps over the lazy dog!";
byte[] textBytes = textRaw.getBytes(StandardCharsets.UTF_8);
EncryptResponse encryptResp = client.encrypt(keyPath, ByteString.copyFrom(textBytes));
It would be nice if the final line could be
EncryptResponse encryptResp = client.encrypt(keyPath, textBytes);
or
EncryptResponse encryptResp = client.encrypt(keyPath, ByteBuffer.wrap(textBytes));
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.