Hi,
Please help...already well googled! (New to
java.)
Going through said book, stuck on chapter 6....FileDumper2 program.
Would someone please download and try to compile these (link below):
1. FileDumper2
2. HexFilter
3. DecimalFilter
4. DumpFilter
5. BufferedStreamCopier from Chapter 6 (6.4)
They will compile but am getting ArrayIndexOutOfBoundsException when try to run Hex and Decimal (ASCII runs ok).
Just cannot see it.
Problem in the fill() method methinks......fill() calls read() calls fill()......
Thanks in advance.
(
http://www.cafeaulait.org/books/javaio2/ioexamples/06/index.html)
C:\Users\john\Desktop\CODE>java FileDumper2 -d FileThree.txt
Exception in
thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at com.elharo.io.DumpFilter.read(DumpFilter.java:26)
at com.elharo.io.DumpFilter.read(DumpFilter.java:53)
at java.io.BufferedInputStream.fill(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at com.elharo.io.BufferedStreamCopier.copy(BufferedStreamCopier.java:23)
at FileDumper2.dump(FileDumper2.java:54)
at FileDumper2.main(FileDumper2.java:29)
C:\Users\john\Desktop\CODE>java FileDumper2 -a FileThree.txt
This is a
test.
C:\Users\john\Desktop\CODE>