-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Export GetNextSize and implement ReadNext
It is useful to be able to efficiently copy objects without decoding them. My use case is filtering when I already know the indices of the objects I want to keep, and for rewriting a dictionary of objects as a column of objects. This commit: 1. Exports `GetNextSize`. 2. Adds a method `ReadNext(p)` to `*Reader`. I wasn't sure about exporting `GetNextSize`, but I can't see the harm in it, and it may be useful for finer-grained control in the copying. I also experimented with a `NextReader() io.Reader` method which returned `io.LimitReader(m.R, GetNextSize()), but for my use case this was twice as slow and also did not handle nested objects. In principle that might be useful for very large simple objects, but is not included in this PR.
- Loading branch information
Showing
3 changed files
with
83 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters