You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@daffodil.apache.org by "Steve Lawrence (JIRA)" <ji...@apache.org> on 2019/08/05 12:08:00 UTC

[jira] [Comment Edited] (DAFFODIL-1748) Investigate use of java.nio.channels

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

Steve Lawrence edited comment on DAFFODIL-1748 at 8/5/19 12:07 PM:
-------------------------------------------------------------------

Note that 3 places in the non-deprecated API still use channels:

{code:scala}
def reload(savedParser: ReadableByteChannel): DataProcessor
def save(output: WritableByteChannel): Unit
def unparse(input: InfosetInputter, output: WritableByteChannel): UnparseResult
{code}

Not sure if save/reload are super important to be changed. But the parse method uses an InputSourceDataInputStream, which acts on InputStream, ByteBuffer, and Array[Byte]--it might make sense for unparse to mimick this and work on those as well, or at least on an OutputStream if we want to keep the API simple. Or perhaps we want something like an OutputSourceDataOutputStream to mimick parse, and that wraps different output methods.


was (Author: slawrence):
Note that 3 places in the non-deprecated API still use channels:
``` scala
def reload(savedParser: ReadableByteChannel): DataProcessor
def save(output: WritableByteChannel): Unit
def unparse(input: InfosetInputter, output: WritableByteChannel): UnparseResult
```
Not sure if save/reload are super important to be changed. But the parse method uses an InputSourceDataInputStream, which acts on InputStream, ByteBuffer, and Array[Byte]--it might make sense for unparse to mimick this and work on those as well, or at least on an OutputStream if we want to keep the API simple. Or perhaps we want something like an OutputSourceDataOutputStream to mimick parse, and that wraps different output methods.

> Investigate use of java.nio.channels
> ------------------------------------
>
>                 Key: DAFFODIL-1748
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-1748
>             Project: Daffodil
>          Issue Type: Improvement
>          Components: API
>            Reporter: Steve Lawrence
>            Priority: Major
>
> We should investigate the use of java.nio.channels in our API. It's possible that the use of standard java.io may have better performance than the use java.nio. Need to investigate and determine if it makes sense to switch.
> Should be done as part of 2.0.0 since this would break the Daffodil API.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)