Problem with copyIn(String sql, Reader from) - Mailing list pgsql-jdbc

From Leonardo F
Subject Problem with copyIn(String sql, Reader from)
Date
Msg-id 234987.48841.qm@web29001.mail.ird.yahoo.com
Whole thread Raw
Responses Re: Problem with copyIn(String sql, Reader from)  (Leonardo F <m_lists@yahoo.it>)
List pgsql-jdbc
Hi,


I tried to use copyIn(final String sql, Reader from) but I always got weird errors:

ERROR: invalid byte sequence for encoding "UTF8": 0x00



I think there's a problem in CopyManager.java, the line:


byte[] buf = encoding.encode(new String(cbuf));


should be

byte[] buf = encoding.encode(new String(len));


???

Otherwise the string to be encoded has always bufferSize length... filled with 0x0...


Am I right?

Everything works fine with the InputStream version.




pgsql-jdbc by date:

Previous
From: Craig Ringer
Date:
Subject: Re: An I/O error occured while sending to the backend.
Next
From: Leonardo F
Date:
Subject: Re: Problem with copyIn(String sql, Reader from)