Skip to content

docs: Java GlideString.asReadOnlyByteBuffer() API - #297

Open
Aryex wants to merge 1 commit into
mainfrom
alexl/agent/glidestring-readonly-bytebuffer
Open

docs: Java GlideString.asReadOnlyByteBuffer() API#297
Aryex wants to merge 1 commit into
mainfrom
alexl/agent/glidestring-readonly-bytebuffer

Conversation

@Aryex

@Aryex Aryex commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

Document the new GlideString.asReadOnlyByteBuffer() method added to the Java client, which provides zero-copy read access to the underlying bytes.

⚠️ Attention: This PR was generated automatically. Verify that all relevant pages have been updated.

Source Commits

  • 5432e9e — feat(java): add asReadOnlyByteBuffer in GlideString to return zero-copy (#6601)

Changes

  • Added "Zero-Copy Access" subsection to the Java tab in commands/valkey-string.mdx
  • Documents getBytes() vs asReadOnlyByteBuffer() with usage examples
  • Notes performance benefit and read-only constraint (ReadOnlyBufferException)

Context

PR #6601 adds asReadOnlyByteBuffer() to GlideString in the Java client. This returns a read-only ByteBuffer view of the stored bytes without copying — useful for high-performance scenarios reading large binary values. The existing getBytes() continues returning a defensive copy for safety.

cc @jingyi-0


This PR was generated by the automated documentation pipeline.

Signed-off-by: kiro-agent <kiro-agent@users.noreply.github.com>
@Aryex Aryex added documentation Improvements or additions to documentation java AI Generated labels Jul 27, 2026
@Aryex Aryex self-assigned this Jul 27, 2026
@Aryex
Aryex marked this pull request as ready for review July 27, 2026 14:58
client.get(gs(byteKey)).get().getString(); // "GlideString value" as a String
```

#### Zero-Copy Access

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already going to be exposed under API (e.g. https://glide.valkey.io/languages/java/api/glide/api/models/GlideString.html), but I suppose it doesn't hurt to keep it on this Valkey string page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Generated documentation Improvements or additions to documentation java

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants