You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by gl...@apache.org on 2004/08/10 04:59:40 UTC
cvs commit: jakarta-poi/src/java/org/apache/poi/util HexDump.java
glens 2004/08/09 19:59:40
Modified: src/java/org/apache/poi/util HexDump.java
Log:
Empty byte array case for HexDump
Revision Changes Path
1.15 +7 -0 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.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- HexDump.java 12 Apr 2004 02:25:14 -0000 1.14
+++ HexDump.java 10 Aug 2004 02:59:40 -0000 1.15
@@ -73,6 +73,12 @@
throws IOException, ArrayIndexOutOfBoundsException,
IllegalArgumentException
{
+ if (data.length == 0)
+ {
+ stream.write( "No Data".getBytes() );
+ stream.flush();
+ return;
+ }
if ((index < 0) || (index >= data.length))
{
throw new ArrayIndexOutOfBoundsException(
@@ -83,6 +89,7 @@
{
throw new IllegalArgumentException("cannot write to nullstream");
}
+
long display_offset = offset + index;
StringBuffer buffer = new StringBuffer(74);
---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-dev-help@jakarta.apache.org