On 27/09/2009, James King <james.king...@gmail.com> wrote: > Hi All, > Currently, there is no readFully method in IOUtils, the method that is > the same as the normal read(b, off, len) in java.io.InputStream, but > tries to ensure that the entire len number of bytes are read. > > There is a readFully method in java.io.DataInput. However, this method > will throw EOFException if the end of file is reached before reading > the specified length of bytes to buf.
Are you suggesting that it is wrong to throw EOFException in this case? How should readFully handle EOF? > Following are the method signatures, > > public static int readFully(InputStream in, byte[] buf); > > public static int readFully(InputStream in, byte[] buf, int off, int len); > > My question is, why not add them to IOUtils? Seems like a good idea to me - why not raise a JIRA enhancement issue for this? > James > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org