You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary Gregory (JIRA)" <ji...@apache.org> on 2019/04/23 17:45:00 UTC

[jira] [Commented] (VFS-704) Some providers wrap their input/output streams twice in a BufferedInputStream

    [ https://issues.apache.org/jira/browse/VFS-704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16824379#comment-16824379 ] 

Gary Gregory commented on VFS-704:
----------------------------------

May you please provide a PRĀ on GitHub to demonstrate a proposal?

> Some providers wrap their input/output streams twice in a BufferedInputStream
> -----------------------------------------------------------------------------
>
>                 Key: VFS-704
>                 URL: https://issues.apache.org/jira/browse/VFS-704
>             Project: Commons VFS
>          Issue Type: Improvement
>    Affects Versions: 2.3
>            Reporter: Boris Petrov
>            Priority: Minor
>
> "DefaultFileContent.getInputStream" gets the input stream from the "fileObject" and then wraps it in "FileContentInputStream" which inherits from "MonitorInputStream" which in turn is a "BufferedInputStream". But some providers return input streams which are already "MonitorInputStream" - e.g. "FtpInputStream" and "HttpInputStream". Which means that they get wrapped twice in a "BufferedInputStream" which is needless waste of memory.
> P.S. The same actually applies for output streams - "FtpOutputStream" e.g.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)