Skip to content

fix(storage): rename ByteBuffer to ByteChunk and hide NIOCore from public API - #1024

Merged
chingor13 merged 2 commits into
googleapis:mainfrom
chingor13:no-nio-surface
Sep 22, 2026
Merged

chingor13 merged 2 commits into
googleapis:mainfrom
chingor13:no-nio-surface

Conversation

@chingor13

Copy link
Copy Markdown
Contributor

Rename GoogleCloudStorage.ByteBuffer to ByteChunk (and conform it to ContiguousBytes) so that it does not shadow or get confused with NIOCore.ByteBuffer in compiler diagnostics and consumer code. Make all NIOCore.ByteBuffer and NIOHTTP1 initializers, properties, and helpers (ByteChunk.init(_: NIOCore.ByteBuffer), ByteChunk.byteBuffer, StreamSource.init(sequence:) where S.Element == NIOCore.ByteBuffer, and StorageClient.parseReadObjectMetadata) internal so that swift-nio types are completely encapsulated within GoogleCloudStorage. Fixes #973

…blic API

Rename `GoogleCloudStorage.ByteBuffer` to `ByteChunk` (and conform it to
`ContiguousBytes`) so that it does not shadow or get confused with
`NIOCore.ByteBuffer` in compiler diagnostics and consumer code.
Make all `NIOCore.ByteBuffer` and `NIOHTTP1` initializers, properties, and
helpers (`ByteChunk.init(_: NIOCore.ByteBuffer)`, `ByteChunk.byteBuffer`,
`StreamSource.init(sequence:) where S.Element == NIOCore.ByteBuffer`, and
`StorageClient.parseReadObjectMetadata`) `internal` so that `swift-nio`
types are completely encapsulated within `GoogleCloudStorage`.
Fixes googleapis#973
@chingor13 chingor13 changed the title fix(storage): rename ByteBuffer to ByteChunk and hide NIOCore from public AIP fix(storage): rename ByteBuffer to ByteChunk and hide NIOCore from public API Sep 22, 2026

@coryan coryan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, TIL

@chingor13
chingor13 marked this pull request as ready for review September 22, 2026 15:07
@chingor13
chingor13 requested a review from a team as a code owner September 22, 2026 15:07
@chingor13
chingor13 merged commit 2d8ba55 into googleapis:main Sep 22, 2026
25 checks passed
@chingor13
chingor13 deleted the no-nio-surface branch September 22, 2026 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

storage: avoid leaking un-exported NIOCore.ByteBuffer in ReadObjectTask.body

2 participants