glens       2003/07/13 06:51:54

  Modified:    src/java/org/apache/poi/util Tag: REL_2_BRANCH HexDump.java
  Log:
  Fixed a small problem with hex dump
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.8.2.2   +3 -1      jakarta-poi/src/java/org/apache/poi/util/HexDump.java
  
  Index: HexDump.java
  ===================================================================
  RCS file: /home/cvs/jakarta-poi/src/java/org/apache/poi/util/HexDump.java,v
  retrieving revision 1.8.2.1
  retrieving revision 1.8.2.2
  diff -u -r1.8.2.1 -r1.8.2.2
  --- HexDump.java      30 Jun 2003 12:21:50 -0000      1.8.2.1
  +++ HexDump.java      13 Jul 2003 13:51:53 -0000      1.8.2.2
  @@ -109,12 +109,14 @@
               throws IOException, ArrayIndexOutOfBoundsException,
                       IllegalArgumentException
       {
  -        if ((index < 0) || (index >= data.length))
  +        if ((index < 0) || (data.length != 0 && index >= data.length))
           {
               throw new ArrayIndexOutOfBoundsException(
                   "illegal index: " + index + " into array of length "
                   + data.length);
           }
  +        if (data.length == 0)
  +            return; // nothing more to do.
           if (stream == null)
           {
               throw new IllegalArgumentException("cannot write to nullstream");
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to