jQuery in Action, 2nd edition*
The moose likes Java in General and the fly likes How to increase the buffer size of the stream Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to increase the buffer size of the stream" Watch "How to increase the buffer size of the stream" New topic
Author

How to increase the buffer size of the stream

chander shivdasani
Ranch Hand

Joined: Oct 09, 2007
Posts: 206

Hi,

I am developing a secure chat-server, in which i have to send rsa keys across client and server. However, when i try to send a key, i only receive part of the key on the other side. I feel the problem is because of the small buffer size. My key is of 1024 bit long. It is a RSA public key.

After googling, i came across two functions in the socket class:

socket.setReceiveBufferSize() and socket.setSendBufferSize().

Even after setting the buffer size, i am getting the same result.

Where am i going wrong?


Enjoy, Chander
SCJP 5, Oracle Certified PL/SQL Developer
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19651
    
  18

Can you show us the small pieces of code you use to send and receive the key?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
chander shivdasani
Ranch Hand

Joined: Oct 09, 2007
Posts: 206

Hi Rob,

That problem is solved. What went wrong was that i was using BufferedReader and PrintWriter to read and write to stream. I changed it to ObjectInputStream and ObjectOutputStream.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to increase the buffer size of the stream
 
Similar Threads
What is the difference between Session and HttpSession?
RSA encryption
Keystore getting corrupted
Reading data from a SocketChannel
Passing Public Key