Renoria
|
 |
«
Posted
2008-12-30 14:40:32 » |
|
Up to now I had to make a new file to hold the decrypted data, and I don't want that. How can I not make a new file, but still read the decrypted data?
Thank you.
|
|
|
|
Matzon
|
 |
«
Reply #1 - Posted
2008-12-30 19:06:38 » |
|
ByteArrayOutputStream ?
|
|
|
|
Renoria
|
 |
«
Reply #2 - Posted
2008-12-31 01:03:10 » |
|
Okay, so how do I wrap that into a java.util.zip.ZipFile? I really need it to be a zipfile, thank you.
|
|
|
|
Games published by our own members! Check 'em out!
|
|
Riven
|
 |
«
Reply #3 - Posted
2008-12-31 10:23:02 » |
|
Why don't you google for answers. You'll find the sourcecode and a proper explaination in less than 3 minutes.
|
Hi, appreciate more people! Σ ♥ = ¾ Learn how to award medals... and work your way up the social rankings!
|
|
|
Renoria
|
 |
«
Reply #4 - Posted
2008-12-31 10:39:30 » |
|
I've already gone through google and sun forums =(
|
|
|
|
Riven
|
 |
«
Reply #5 - Posted
2008-12-31 10:47:11 » |
|
|
Hi, appreciate more people! Σ ♥ = ¾ Learn how to award medals... and work your way up the social rankings!
|
|
|
Renoria
|
 |
«
Reply #6 - Posted
2008-12-31 10:51:18 » |
|
Aww, that doesn't use java.util.ZipFile
|
|
|
|
|
Renoria
|
 |
«
Reply #8 - Posted
2008-12-31 11:14:01 » |
|
Okay, just one more problem... ZipFile constructors don't take an InputStream parameter, I can't pass the decrypted data into the ZipFile constructor 
|
|
|
|
Riven
|
 |
«
Reply #9 - Posted
2008-12-31 11:20:08 » |
|
A ZipFile is based on a FILE, so it takes a File in its constructor, like the name suggests. A ZipInputStream is based on an INPUTSTREAM, so it takes an InputStream in its constructor, like the name suggests.
You can't use ZipFile and feed it an InputStream You can't use ZipInputStream and feed it a File
So what you want is NOT POSSIBLE.
Pick one, of the above, or pick a different hobby.
|
Hi, appreciate more people! Σ ♥ = ¾ Learn how to award medals... and work your way up the social rankings!
|
|
|
Games published by our own members! Check 'em out!
|
|
Renoria
|
 |
«
Reply #10 - Posted
2008-12-31 11:22:20 » |
|
Ok I see, I'll have to hack around it =/
Is it possible to get a file from a ZipInputStream? By giving it the name of the file I mean
|
|
|
|
Renoria
|
 |
«
Reply #11 - Posted
2008-12-31 11:38:10 » |
|
Yay I figured it out =) I had to subclass ByteArrayOutputStream and add a name property.
Thanks Riven and Matzon!
|
|
|
|
cylab
|
 |
«
Reply #12 - Posted
2008-12-31 14:49:10 » |
|
If that doesn't cut it for you, you might have to change your hobby, as this spoonfeeding is rediculous.
 Come on, he is 14!!! @Renoria Keep it up! 
|
Mathias - I Know What [you] Did Last Summer!
|
|
|
Renoria
|
 |
«
Reply #13 - Posted
2008-12-31 14:56:04 » |
|
 Come on, he is 14!!! @Renoria Keep it up!  Thanks for the support 
|
|
|
|
Riven
|
 |
«
Reply #14 - Posted
2008-12-31 15:11:47 » |
|
 Come on, he is 14!!! Oh well, it's just silly how every trivial question gets its own thread with a code dump and a one line question. The replies are largely ignored, and a new thread is started when the next problem is stumbled on. If you're so reliant on the community, and really can't solve your own problems, then yes, a different hobby might result in actually getting something done. Regarding the age... if he was 10, ok. But with 14 you should be able to do better. Anyway, so much for spilling my annoyances.
|
Hi, appreciate more people! Σ ♥ = ¾ Learn how to award medals... and work your way up the social rankings!
|
|
|
woogley
|
 |
«
Reply #15 - Posted
2008-12-31 18:54:01 » |
|
If you're so reliant on the community, and really can't solve your own problems, then yes, a different hobby might result in actually getting something done.
Regarding the age... if he was 10, ok. But with 14 you should be able to do better.
STFU Riven, you're acting like the GameDev.net assholes This is the newbie board you know, so chill.
|
|
|
|
Renoria
|
 |
«
Reply #16 - Posted
2009-01-01 01:16:58 » |
|
STFU Riven, you're acting like the GameDev.net assholes
This is the newbie board you know, so chill.
Lol, that community would rather see you fail than succeed. Btw, why is Riven a guest?
|
|
|
|
i30817
|
 |
«
Reply #17 - Posted
2009-01-06 00:32:21 » |
|
If you're trying to convert a outputstream into a inputstream that is a moderately complicated operation that requires a additional thread and a piped output/input streams combination. http://ostermiller.org/convert_java_outputstream_inputstream.htmlYou can combine this with the Executors to give your thread if you want some thread charactheristics (one thread per archive/execution whatever thread strategies, priority, cancelation (since pipedoutputstreams actually respond to interrups by throwing a Interrupted runtime exception - important - THE ONLY STREAMS IN THE STD LIBRARY THAT DO THIS -, etc)
|
|
|
|
gouessej
|
 |
«
Reply #18 - Posted
2009-01-06 11:15:23 » |
|
Lol, that community would rather see you fail than succeed.
What do you mean? I think that Javagaming.org doesn't want to see you fail even though sometimes, some of us are a bit blunt (especially me and more than Riven). Personally, I want you to succeed. I began programming my first video game on a pocket calculator HP 48 GX in RPL when I was about 15, I had no computer, rarely access to internet and when I had a problem, I had to solve it by myself, it was difficult.
|
|
|
|
gimbal
|
 |
«
Reply #19 - Posted
2009-01-06 19:00:57 » |
|
I believe he (or she?) was talking about gamedev.net. Both gamedev and forums.sun.com are very harsh environments for new/young/lazy programmers. Sarcasm, douchebagness and plain personal attacks are quite common.
|
|
|
|
i30817
|
 |
«
Reply #20 - Posted
2009-01-06 21:58:41 » |
|
BTW, i am actually making something similar. I don't think you should use my code, since it does a lot more than what you want and the focus is likely to be different (i want to search with programatic "rules" all the files in a archive) but here is my code (search the compressed package). http://code.google.com/p/bookjar-utils/source/browse/
|
|
|
|
Eli Delventhal
|
 |
«
Reply #21 - Posted
2009-01-06 23:26:22 » |
|
Maybe that was someone trying to ransack Riven's name by being super mean. 
|
|
|
|
Riven
|
 |
«
Reply #22 - Posted
2009-01-07 20:14:50 » |
|
Maybe that was someone trying to ransack Riven's name by being super mean.  I wish that was true. It was me and I was very blunt, due to some setbacks in personal life, which does not justify my behaviour. Anyway, I was not banned, I was so furious I deleted my account. Things have 'settled' since then, and I'm peeking at these forums again, for what it's worth... Apologies to Renoria, ofcourse.
|
Hi, appreciate more people! Σ ♥ = ¾ Learn how to award medals... and work your way up the social rankings!
|
|
|
Renoria
|
 |
«
Reply #23 - Posted
2009-01-08 05:19:42 » |
|
No, I see how you feel 
|
|
|
|
Eli Delventhal
|
 |
«
Reply #24 - Posted
2009-01-08 16:59:12 » |
|
I wish that was true. It was me and I was very blunt, due to some setbacks in personal life, which does not justify my behaviour. Anyway, I was not banned, I was so furious I deleted my account. Things have 'settled' since then, and I'm peeking at these forums again, for what it's worth...
Apologies to Renoria, ofcourse.
But... but... all of your posts! You should have named yourself "Myst" this time 'round. 
|
|
|
|
kevglass
|
 |
«
Reply #25 - Posted
2009-01-08 17:03:26 » |
|
Good to see you back Riven.
Kev
|
|
|
|
Riven
|
 |
«
Reply #26 - Posted
2009-01-08 19:08:19 » |
|
OfftopicBut... but... all of your posts! You should have named yourself "Myst" this time 'round.  I never really cared about postcount. Anyway, about 5 years ago I created my account and was pondering about the name. Myst crossed my mind, but the gfx of Riven were just way better, and I wanted to use the game in my avatar: one of the few ingame movies in Riven, where the dinos slide into the waterI spent a few hours making my current avatar, it's peacefully weird... Good to see you back Riven.
Nice to hear!
|
Hi, appreciate more people! Σ ♥ = ¾ Learn how to award medals... and work your way up the social rankings!
|
|
|
|