true stream optimizing needs subclassing java.io.InputStream

Поиск
Список
Период
Сортировка
От Michael Adler
Тема true stream optimizing needs subclassing java.io.InputStream
Дата
Msg-id Pine.NEB.4.44.0206271317140.10295-100000@reva.sixgirls.org
обсуждение исходный текст
Ответ на Re: DBVisualizer Null Pointer Exception  (Robert Treat <rtreat@webmd.net>)
Список pgsql-jdbc
This continues the discussion of optimizing the reading of characters from
the backend.

From what I can tell, PG_Stream.ReceiveChar() is no less efficient
(approximately) than PG_Stream.Receive(byte[] b, int off, int length). The
later is simply a wrapper around InputStream's method read(b,off,len). My
test showed little or no difference between the two methods. We would need
to override read(b,off,len) for true improvements.

from java.io.InputStream:

<snip>

 The read(b, off, len) method for class InputStream simply calls the
method read() repeatedly. If the first such call results in an
IOException, that exception is returned from the call to the read(b,
off, len) method. If any subsequent call to read() results in a
IOException, the exception is caught and treated as if it were end of
file; the bytes read up to that point are stored into b and the number
of bytes read before the exception occurred is returned. Subclasses are
encouraged to provide a more efficient implementation of this method.

</snip>

I still have to test this over a modem. The high latency may demonstrate
the benefits of buffering.


Mike




В списке pgsql-jdbc по дате отправления:

Предыдущее
От: "Tim Lucia"
Дата:
Сообщение: Re: Interrupt execution
Следующее
От: "Konstantinos Spyropoulos"
Дата:
Сообщение: Re: Problem with JDBC: no suitable driver