Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (539)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (603)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  How do I decrypt a zip file without making a new file?  (Read 4874 times)
0 Members and 1 Guest are viewing this topic.
Offline Renoria

Junior Devvie




...


« 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.
Offline Matzon

JGO Knight


Medals: 19
Projects: 1


I'm gonna wring your pants!


« Reply #1 - Posted 2008-12-30 19:06:38 »

ByteArrayOutputStream ?

Offline Renoria

Junior Devvie




...


« 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!
Legends of Yore - The Casual Retro Roguelike
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 841
Projects: 4
Exp: 16 years


Hand over your head.


« 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
Offline Renoria

Junior Devvie




...


« Reply #4 - Posted 2008-12-31 10:39:30 »

I've already gone through google and sun forums =(
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 841
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #5 - Posted 2008-12-31 10:47:11 »

http://www.google.com/search?q=java+extract+zip+file

first result:
http://www.java-tips.org/java-se-tips/java.util.zip/how-to-extract-file-files-from-a-zip-file-3.html


See?

Combine that with the excelent advice Matzon gave you, and you're ready to go.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social
Offline Renoria

Junior Devvie




...


« Reply #6 - Posted 2008-12-31 10:51:18 »

Aww, that doesn't use java.util.ZipFile
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 841
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #7 - Posted 2008-12-31 11:11:07 »

Oh no! Then you're so stuck! Poor you.


If this is a homework assignment, ask your teacher.


Oh wait... instead of
http://www.google.com/search?q=java+extract+zip+file
you might try
http://www.google.com/search?q=java+extract+zipfile

And click on the first result:
http://www.devx.com/getHelpOn/10MinuteSolution/20447


See?

Combine that with the excelent advice Matzon gave you, and you're ready to go.


If that doesn't cut it for you, you might have to change your hobby, as this spoonfeeding is rediculous.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social
Offline Renoria

Junior Devvie




...


« 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  Undecided
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 841
Projects: 4
Exp: 16 years


Hand over your head.


« 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
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Renoria

Junior Devvie




...


« 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
Offline Renoria

Junior Devvie




...


« 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!
Offline cylab

JGO Ninja


Medals: 55



« 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.

Angry Come on, he is 14!!!

@Renoria
Keep it up! Smiley

Mathias - I Know What [you] Did Last Summer!
Offline Renoria

Junior Devvie




...


« Reply #13 - Posted 2008-12-31 14:56:04 »

Angry Come on, he is 14!!!

@Renoria
Keep it up! Smiley

Thanks for the support  Grin
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 841
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #14 - Posted 2008-12-31 15:11:47 »

Angry 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
Offline 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.
Offline Renoria

Junior Devvie




...


« 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?
Offline i30817

Junior Devvie





« 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.html

You 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)
Offline 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.

Offline gimbal

JGO Knight


Medals: 25



« 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.
Offline i30817

Junior Devvie





« 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/
Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 11
Exp: 10 years


Game Engineer


« Reply #21 - Posted 2009-01-06 23:26:22 »

Maybe that was someone trying to ransack Riven's name by being super mean.  Shocked

See my work:
OTC Software
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 841
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #22 - Posted 2009-01-07 20:14:50 »

Maybe that was someone trying to ransack Riven's name by being super mean.  Shocked

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
Offline Renoria

Junior Devvie




...


« Reply #23 - Posted 2009-01-08 05:19:42 »

No, I see how you feel Cheesy
Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 11
Exp: 10 years


Game Engineer


« 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.  Tongue

See my work:
OTC Software
Offline kevglass

« JGO Spiffy Duke »


Medals: 212
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #25 - Posted 2009-01-08 17:03:26 »

Good to see you back Riven.

Kev

Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 841
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #26 - Posted 2009-01-08 19:08:19 »

Offtopic



But... but... all of your posts!

You should have named yourself "Myst" this time 'round.  Tongue

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 water

I 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
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

rwatson462 (35 views)
2014-12-15 09:26:44

Mr.CodeIt (26 views)
2014-12-14 19:50:38

BurntPizza (55 views)
2014-12-09 22:41:13

BurntPizza (88 views)
2014-12-08 04:46:31

JscottyBieshaar (50 views)
2014-12-05 12:39:02

SHC (65 views)
2014-12-03 16:27:13

CopyableCougar4 (68 views)
2014-11-29 21:32:03

toopeicgaming1999 (128 views)
2014-11-26 15:22:04

toopeicgaming1999 (119 views)
2014-11-26 15:20:36

toopeicgaming1999 (34 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!