Skip to content

feat(io): add read_all to FileRead - #2882

Closed
xanderbailey wants to merge 2 commits into
apache:mainfrom
xanderbailey:xb/file_read_all
Closed

xanderbailey wants to merge 2 commits into
apache:mainfrom
xanderbailey:xb/file_read_all

Conversation

@xanderbailey

@xanderbailey xanderbailey commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Add a read_all method to the FileRead trait for reading an entire file's content without the caller having to know its length. Each implementation knows its own size, and for encrypted readers (AesGcmFileRead) it returns the decrypted plaintext.

This will allow a future ManifestReader to store just a dyn FileRead with a new(InputFile) and new_from_encrypted(EncryptedInputFile) constructor.

Working towards #2881

What changes are included in this PR?

Add a read_all method to the FileRead trait

Are these changes tested?

Add a `read_all` method to the `FileRead` trait for reading an entire
file's content without the caller having to know its length. Each
implementation knows its own size, and for encrypted readers
(`AesGcmFileRead`) it returns the decrypted plaintext.

Implemented across all readers: in-memory, local filesystem, opendal,
the AES-GCM decrypting reader, and the byte-counting scan wrapper.
@xanderbailey

Copy link
Copy Markdown
Contributor Author

Actually, I changed my mind and decided to do the ManifestReader a different way.

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.

1 participant