Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename RealSource and RealSink to BufferedSource and BufferedSink #362

Open
JakeWharton opened this issue Aug 2, 2024 · 2 comments
Open

Comments

@JakeWharton
Copy link
Contributor

Now that the public API type naming was simplified from Okio, the Buffered- prefixes can be used for the implementations to more correctly convey their behavior. The use of "Real" in Okio is simply because we had to pick something (and Jesse doesn't like "Impl"-suffixed names).

@fzhinkin
Copy link
Collaborator

Source and Sink interfaces already imply bufferization, so SourceImpl and SinkImpl could be a better choice.

@fzhinkin fzhinkin added this to the kotlinx-io stabilization milestone Aug 12, 2024
@JakeWharton
Copy link
Contributor Author

In #363 (comment) you say:

For instance, we can support memory mapped files by implementing Sink/Source interfaces, but using file descriptor/MappedByteBuffer/pointer as a buffer, instead of Buffer.

which leads me to believe we want implementation names that reflect the implementation strategy. Otherwise we wouldn't need subtypes at all and Sink and Source could be final classes.

I'm not saying the prefix needs to be Buffered, but something to indicate that it's a Buffer-backed Source and Buffer-backed Sink other than "real" or "impl" would be nice, especially given that other subtypes might exist.

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

No branches or pull requests

3 participants