Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Overloads for flattened ByteString method args #3590

Copy link
Copy link

Description

@bdhess
Issue body actions

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.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.