private static int readResource ( DocPath resource , InputStream in , byte [ ] buf ) throws ResourceIOException { try { return in . read ( buf ) ; } catch ( IOException e ) { throw new ResourceIOException ( resource , e ) ; } }
Reads from an input stream opened from a given resource into a given buffer . If an IOException occurs it is wrapped in a ResourceIOException .