Jay George

Greenhorn
+ Follow
since Jul 28, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jay George

Check out the JExcel API by Andy Khan... very good tool, and a great support forum on Yahoo Groups. http://www.andykhan.com/jexcelapi/index.html

Apache POI HSSF also has some Excel APIs.

Personally speaking, I prefer JExcel.
18 years ago
Hey everybody. Given a file, I am trying to read a series of bytes that begin at a place other than the beginning of the file (e.g: I'm trying to read 512 bytes from a 1 MB file starting with the 90th byte). Is there any way to do this without reading in or processing the bytes before it?

I've tried using InputStream's read(byte[] b, int off, int len) method, but I get an IndexOutOfBoundsException whenever the offset is something other than zero.

This is a snippet from the code I have so far:



If I change the offset to zero, I get no exceptions. FYI, the file I am attempting to read from has 19968 bytes.

So is this even possible? Is there a better way to do this other than using FileInputStream? Thanks in advance.
18 years ago

The latter (in reference to fileset of classes) obviously isn't something the JVM does understand.



How come the JVM understands the fileset of jar files, but not the fileset of class files?
19 years ago
Today, I was compiling some java files with an ant script. I wanted to include a combination of jar files and class files on javac's classpath.

Originally, I included those class files in a <fileset>. Unfortunately, my build failed with errors because it couldn't see the required class files. However, once I changed the tag from fileset to "pathelement", the class files got picked up, and my build succeeded.

So my question is, what is the difference between "fileset" and "pathelement"? And why do the class files need to be included in a <pathelement> instead of <fileset>? I googled around for the answer, but couldn't find any satisfactory explanation.

Thanks.

FYI, my javac structure (the one that compiles successfully) looked similar to this:
<javac srcdir="src" destdir="build">
<classpath>
<pathelement path="${OtherApp.builddir}/classes" />
<fileset dir="tomcat/abc/lib" includes="*.jar"/>
<fileset dir="tomcat/xyz/lib" includes="*.jar"/>
</classpath>
</javac>
19 years ago