On Tue, 27 Feb 2007, Stephen Denne wrote:
> I had a different implementation in mind for Send(byte buf[], int off,
> int siz) along the lines of:
>
I'm not convinced this will be significantly faster, but it is slightly
clearer, so I've incorporated it.
> Is there a reason for removing pg_input.ensureBytes(siz)? I see you're
> checking the length of what was read instead. Is this always equivalent
> or sufficient? Does it block in diferent ways?
Internally VisibleBufferedInputStream will end up calling ensureBytes in
the read call. I don't think the actual read length check is necessary,
but it's the sort of thing that could easily break if we changed the
VisbibleBufferedInputStream implementation.
> When converting ints to bytes, you do not need to mask with 255 (see
> int0 to int3 in java.nio.Bits).
Yes, removed.
> Is it possible other people have code that is calling
> ReceiveIntegerR(int siz)?
>
No, PGStream is an internal only class.
Kris Jurka