Skip to content

Commit

Permalink
backpatch changes to 42.2.x for 42.5.1 (#2673)
Browse files Browse the repository at this point in the history
  • Loading branch information
davecramer committed Nov 23, 2022
1 parent 76564a8 commit 91b8c2c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pgjdbc/src/main/java/org/postgresql/util/StreamWrapper.java
Expand Up @@ -17,6 +17,9 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
//#if mvn.project.property.postgresql.jdbc.spec >= "JDBC4.1"
import java.nio.file.Files;
//#endif

/**
* Wrapper around a length-limited InputStream.
Expand Down Expand Up @@ -51,7 +54,12 @@ public StreamWrapper(InputStream stream) throws PSQLException {

if (memoryLength == -1) {
final int diskLength;
final File tempFile = File.createTempFile(TEMP_FILE_PREFIX, null);
final File tempFile =
//#if mvn.project.property.postgresql.jdbc.spec >= "JDBC4.1"
Files.createTempFile(TEMP_FILE_PREFIX, null).toFile();
//#else
File.createTempFile(TEMP_FILE_PREFIX, null);
//#endif
FileOutputStream diskOutputStream = new FileOutputStream(tempFile);
diskOutputStream.write(rawData);
try {
Expand Down

0 comments on commit 91b8c2c

Please sign in to comment.