Skip to content

Implement WriterTo / ReaderFrom #669

Description

@FiloSottile

If we implement io.ReaderFrom on stream.EncryptWriter and io.WriterTo on stream.DecryptReader we can save one(?) copy in io.Copy invocations, because io.Copy can skip the buffer (if the other side didn't already implement WriterTo / ReaderFrom). That would help throughput. See also #646.

We can also use the WriterTo / ReaderFrom on the underlying src / dst. This might or might not combine well because we still need somewhere to do the encryption/decryption.

For the new age.EncryptReader, we'll need to first find a way to wire the io.WriterTo through the io.MultiReader.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions