D. Nguyen

Greenhorn
+ Follow
since Jun 09, 2006
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 D. Nguyen

Thanks, but i'm looking for a way to do this without extra typing at the command line
so just when i type java Test <input.txt
16 years ago
Hi,

When i'm calling a program, for example java Test <input.txt
i'd like to get the name of the file, in this example input.txt
How should i do this? I'm making a new DataInputStream(System.in), but I have no idea how I can get the name of the inputfile (because you also can't acces it in the args array of the mainmethod).
Thanks in advance.
16 years ago
Thank you Clifton Craig. As I expected there's no easy solution, but what you described is exactly what I need. I will try your first approach first. I already have something similar in my program, using piped input/outputstream to turn an outputstream to an inputstream, but I was wondering if there wasn't an easy solution.
17 years ago
Thanks for your reply.

I have an Inputstream, more exactly a FileInputStream. I need to zip this stream, but the result has to be an inputstream also.

(the file has to be send by network, that's why I want to zip it, so the program has to send less bytes).

I hope you will understand my question better now?
17 years ago
Hi,

I've got an inputstream which I want to zip. But the results has to be an inputstream also. Is this possible?
Because if I understood some tutorials correctly, you will get an outputstream if you zip an inputstream (for example: a file).

Thanks in advance.
17 years ago