8000
  • Read the underlying buffer in SshDataStream by Rob-Hague · Pull Request #1638 · sshnet/SSH.NET · GitHub
    [go: up one dir, main page]

    Skip to content

    Read the underlying buffer in SshDataStream#1638

    Merged
    Rob-Hague merged 2 commits intosshnet:developfrom
    Rob-Hague:sshdatastream
    May 4, 2025
    Merged

    Read the underlying buffer in SshDataStream#1638
    Rob-Hague merged 2 commits intosshnet:developfrom
    Rob-Hague:sshdatastream

    Conversation

    @Rob-Hague
    Copy link
    Collaborator

    SshDataStream is a MemoryStream, so we can access the buffer directly. Also simplify some usage in PrivateKeyFile.

    SshDataStream is a MemoryStream, so we can access the buffer directly.
    Also simplify some usage in PrivateKeyFile.
    /// Reads a length-prefixed byte array from the SSH data stream,
    /// returned as a view over the underlying buffer.
    /// </summary>
    internal ArraySegment<byte> ReadBinarySegment()
    Copy link
    Collaborator Author
    @Rob-Hague Rob-Hague May 3, 2025

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    later this will be used in SshData to remove large array allocations when reading e.g. ChannelDataMessage (the motivation for this change)

    @Rob-Hague Rob-Hague merged commit 7c07b10 into sshnet:develop May 4, 2025
    4 checks passed
    @Rob-Hague Rob-Hague deleted the sshdatastream branch May 4, 2025 10:39
    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.

    2 participants

    0