<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:53:38 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[JAVA-1024] Change visibility of GridFSDBFile.getChunk(int) to public</title>
                <link>https://jira.mongodb.org/browse/JAVA-1024</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;We are using GridFS to store multipart/mixed mime messages. We would like to read these messages from GridFS via the mongodb java driver. The messages can be large up to GB size.&lt;br/&gt;
Since the mime parser has to reposition and create sub streams on part of the stream we started to implement our own InputStream that implemented &lt;a href=&quot;https://javamail.java.net/nonav/docs/api/javax/mail/internet/SharedInputStream.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://javamail.java.net/nonav/docs/api/javax/mail/internet/SharedInputStream.html&lt;/a&gt;&lt;br/&gt;
and also added support for mark and reset. We used GridFSDBFile to do this but we needed to use the getChunk method which unfortunately is package private. To circumvent this we implemented&lt;br/&gt;
a helper class in the same package as GridFSDBFile that called getChunk. Unfortunately this workaround does not work in our deployment environment since we are using an osgi platform.&lt;/p&gt;

&lt;p&gt;So if it is possible we would like you to change the visibility of the getChunk method to public.&lt;/p&gt;</description>
                <environment></environment>
        <key id="94392">JAVA-1024</key>
            <summary>Change visibility of GridFSDBFile.getChunk(int) to public</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="2">Won&apos;t Fix</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="Hallonbat">Jan Hallonsten [X]</reporter>
                        <labels>
                    </labels>
                <created>Wed, 16 Oct 2013 12:22:49 +0000</created>
                <updated>Thu, 3 Sep 2015 19:44:20 +0000</updated>
                            <resolved>Thu, 3 Sep 2015 19:44:20 +0000</resolved>
                                    <version>2.11.3</version>
                                                    <component>GridFS</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="1021961" author="jeff.yemin" created="Thu, 3 Sep 2015 19:44:20 +0000"  >&lt;p&gt;We didn&apos;t make getChunk public, but rather added markSupported, mark, and reset support in the new GridFS implementation &lt;/p&gt;</comment>
                            <comment id="1020333" author="ross@10gen.com" created="Wed, 2 Sep 2015 09:06:41 +0000"  >&lt;p&gt;Fixed in the new GridFS implementation &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-1713&quot; title=&quot;Create new GridFS API&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-1713&quot;&gt;&lt;del&gt;JAVA-1713&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Mark and reset support was added in &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-1917&quot; title=&quot;GridFSInputStream should support mark and reset&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-1917&quot;&gt;&lt;del&gt;JAVA-1917&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="441807" author="hallonbat" created="Wed, 16 Oct 2013 19:38:29 +0000"  >&lt;p&gt;I guess that you are right it would be sufficient with an implementation of InputStream.mark() and InputStream.reset() which implies that InputStream.markSupported() is changed to return true. Then we could just implement the SharedInputStream.newStream(long start, long end) by calling GridFSDBFile.getInputStream() and then use InputStream.skip(long) to position the new stream at the correct position and then wrap that stream with our own stream implementation that keeps track of the current position and makes sure that the stream is not read past the provided end position.&lt;/p&gt;

&lt;p&gt;One disadvantage for us with that approach would be that the same chunk would have to be retrieved several times, first for the parent stream and the again for the sub streams returned by SharedInputStream.newStream. If we had access to the getChunk method we could reuse the chunk if the start position of the new stream is within the currentChunk.&lt;/p&gt;

&lt;p&gt;So if you would not like to commit to having getChunk public we could solve our use case with just mark, reset and skip but we would have more possibilities with getChunk.&lt;/p&gt;</comment>
                            <comment id="441490" author="jeff.yemin" created="Wed, 16 Oct 2013 14:24:28 +0000"  >&lt;p&gt;As I mentioned on mongodb-user, I&apos;d like to consider the alternative of implementing InputStream.mark() and InputStream.reset() on com.mongodb.gridfs.GridFSDBFile.MyInputStream.  Currently they both throw an exception.   Would mark and reset support on the InputStream returned by GridFSDBFile#getInputStream be sufficient?&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrga6n:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>8552</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>