commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Gregory (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (IO-410) [IO] Readfully() That Returns A Byte Array
Date Fri, 22 Nov 2013 01:25:35 GMT

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

Gary Gregory commented on IO-410:
---------------------------------

Beluga,

We welcome patches with unit tests ;) 

Make sure you look at the HEAD of trunk in SVN for additional unreleased functionality.

Gary

> [IO] Readfully() That Returns A Byte Array
> ------------------------------------------
>
>                 Key: IO-410
>                 URL: https://issues.apache.org/jira/browse/IO-410
>             Project: Commons IO
>          Issue Type: Wish
>          Components: Utilities
>            Reporter: BELUGA BEHR
>            Priority: Minor
>
> I am looking for an implementation withe the following method signature:
> {code}
> public static byte[] readFully(final InputStream input, long length) throws IOException
> {code}
> I have needed this when parsing different protocols.  For example, if the protocol has
a fixed-length header with 40 bytes, I may just want to instantiate the small buffer with
the entire header and then pick it apart.  In my implementation of my business logic, if the
header cannot be read in then it should throw an exception for being malformed.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message