aspose file tools*
The moose likes I/O and Streams and the fly likes inputStream freezes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "inputStream freezes" Watch "inputStream freezes" New topic
Author

inputStream freezes

Tomasz Lamek
Greenhorn

Joined: Apr 27, 2010
Posts: 3
Hi. I have problem with my aplication. You must run it with argument 0(for server) and 1(for client).



I don't know why but it freezes on the ObjectInputStream constructors with Cipher streams. When I don't use
Cipher stream it works. When i have only ois = new ObjectInputStream(new CipherInputStream(s.getInputStream(), cipher2)); in the server and ous = new ObjectOutputStream(new CipherOutputStream(s.getOutputStream(), cipher2)); in the client it works too. What i'm doing wrong?
Thanks for your help and sorry for my english.
greetings for you all.
him jain
Ranch Hand

Joined: Feb 05, 2010
Posts: 56
hi!!

I didn't get one thing in your code.You have used:
ObjectOutputStream ous = new ObjectOutputStream(s.getOutputStream());

and after that you have again allocated it with:
ous = new ObjectOutputStream(new CipherOutputStream(s.getOutputStream(), cipher));

So, I didn't get this part. when you have already obtained a stream ous, then wy are you not using this stream and re-intializing it.
This must not produce any result.
Anyways, what's the output you are getting?
I think error is with this stream only.
First have a socket -> then obtain a stream -> use it to read/write.
Hope it helped.


--Himanshu Jain
http://jainhim.blogspot.com/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: inputStream freezes
 
Similar Threads
Overhead IO : The cryptic case of the extra bytes
BadPaddingException using AES
RSA encryption
Digital Signature in PKCS 7 format with base 64 encoding
encrypt and decrypt a file in Java