Sandeep Sharma wrote:
> Dear Stephan Schiessling
> 
> I don't think read(byte[] ...) methods calls read
> internally

Look at java.io.InputStream, but of course in a sub class these can
be implemented by an own implementation.

> 
> what i believe is that when u call getInputStream on
> socket it would return Ref to instance of
> SocketInputStream Class that contains a native method
> called socketRead(byte b[], int off, int len) 
> 
> i would like u to go through the source code of the
> SocketInputStream class

You have a little problem, if you use CharTerminatedInputStream
with read(byte[], ...) (without subcalls to read()):
This InputStream may read too much bytes and these bytes may have to 
feed these extra bytes back into the "super"-InputStream. The mark/reset 
features of InputStream may not be supported, so that you may end up 
useing some extra BufferedInputStream.

CharTerminatedInputStream does not directly use an InputStream of a 
Socket, so I think the only way to check if you can get performance
improvements is to write an alternative class and test it.


Bye,

Stephan Schiessling





--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to