comparison src/main/java/org/monetdb/jdbc/MonetConnection.java @ 526:6060ca8c5c1a onclient

Add test for uploadFrom methods
author Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
date Thu, 26 Aug 2021 14:24:31 +0200 (2021-08-26)
parents 72007c4f8f8a
children c9d88af06d35
comparison
equal deleted inserted replaced
525:70ff796c42f7 526:6060ca8c5c1a
3334 } 3334 }
3335 3335
3336 uploadFrom(reader); 3336 uploadFrom(reader);
3337 } 3337 }
3338 3338
3339 public void uploadFrom(BufferedReader reader) throws IOException { 3339 public void uploadFrom(Reader reader) throws IOException {
3340 OutputStream s = getStream(); 3340 OutputStream s = getStream();
3341 OutputStreamWriter writer = new OutputStreamWriter(s, StandardCharsets.UTF_8); 3341 OutputStreamWriter writer = new OutputStreamWriter(s, StandardCharsets.UTF_8);
3342 char[] buffer = new char[64 * 1024]; 3342 char[] buffer = new char[64 * 1024];
3343 while (true) { 3343 while (true) {
3344 int nread = reader.read(buffer, 0, buffer.length); 3344 int nread = reader.read(buffer, 0, buffer.length);