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

[Feature Request]: SeekableXZInputStream ability to write straight into java.nio.ByteBuffer #2

Open
xbotuk opened this issue Jan 15, 2023 · 4 comments

Comments

@xbotuk
Copy link

xbotuk commented Jan 15, 2023

Describe the Feature

Can you please add methods in SeekableXZInputStream ability to write straight into an existing java.nio.ByteBuffer

This is to replicate something like

ByteBuffer bytebuffer = ByteBuffer.allocateDirect(65536);
RandomAccessFile raf = new RandomAccessFile(filePath, "r");
FileChannel fc = raf.getChannel();
ByteBuffer.allocateDirect(this.bufferSize);

// call next statements many ties  by seeking various positions
fc.read(bytebuffer);
bytebuffer.flip();

Expected Complications

ByteBuffer is available since old versions of java, so adding this feature should not be an issue.

Will I try to implement this new feature?

No

@JiaT75
Copy link
Contributor

JiaT75 commented Jan 16, 2023

Hi! Thank you for the feature request. Unfortunately, this is the wrong repository for this since this is XZ Utils (the C version). XZ for Java has not been moved to GitHub yet, so the code repository is still located at https://git.tukaani.org/xz-java.git.

So, until we move XZ for Java to GitHub, you will need to request features or report bugs either to [email protected] or the xz-devel mailing list. Instructions for subscribing to the mailing list are documented here: https://tukaani.org/xz/lists.html. You do not need to subscribe to the mailing list to email [email protected], but then only the maintainers will be able to see your mails.

Thanks again for the feature request!

@JiaT75
Copy link
Contributor

JiaT75 commented Feb 24, 2023

Now that the XZ for Java repository has officially moved to GitHub this issue has been moved and reopened. This isn't a promise that we will implement the feature, just that we are considering it now.

@bokken
Copy link
Contributor

bokken commented Feb 12, 2024

Is the ask here to implement ReadableByteChannel?
https://docs.oracle.com/javase/8/docs/api/java/nio/channels/ReadableByteChannel.html

@Larhzu
Copy link
Member

Larhzu commented Jul 29, 2024

I still haven't really looked into this. SeekableByteChannel would be a standard interface so perhaps that could be valuable? All internal APIs use streams and I suppose it doesn't make sense to change that. So ByteChannel support would be some sort of thin wrapper.

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

No branches or pull requests

4 participants