Uploaded image for project: 'Commons IO'
  1. Commons IO
  2. IO-410

[IO] Readfully() That Returns A Byte Array

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Wish
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 2.5
    • Utilities
    • None

    Description

      I am looking for an implementation withe the following method signature:

      public static byte[] readFully(final InputStream input, long length) throws IOException
      

      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.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            belugabehr David Mollitor
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment