Package org.postgresql.util
Class StreamWrapper
java.lang.Object
org.postgresql.util.StreamWrapper
- All Implemented Interfaces:
Closeable,AutoCloseable
Wrapper around a length-limited InputStream.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate LazyCleaner.Cleanable<IOException> private final Objectprivate final intprivate static final intprivate final intprivate final byte[]private final InputStreamprivate static final Stringprivate TempFileHolder -
Constructor Summary
ConstructorsConstructorDescriptionStreamWrapper(byte[] data, int offset, int length) StreamWrapper(InputStream stream) StreamWrapper(InputStream stream, int length) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()private static intcopyStream(InputStream inputStream, OutputStream outputStream, int limit) byte[]getBytes()intinttoString()
-
Field Details
-
MAX_MEMORY_BUFFER_BYTES
private static final int MAX_MEMORY_BUFFER_BYTES- See Also:
-
TEMP_FILE_PREFIX
- See Also:
-
stream
-
tempFileHolder
-
leakHandle
-
cleaner
-
rawData
private final byte[] rawData -
offset
private final int offset -
length
private final int length
-
-
Constructor Details
-
StreamWrapper
public StreamWrapper(byte[] data, int offset, int length) -
StreamWrapper
-
StreamWrapper
- Throws:
PSQLException
-
-
Method Details
-
getStream
- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
getLength
public int getLength() -
getOffset
public int getOffset() -
getBytes
public byte[] getBytes() -
toString
-
copyStream
private static int copyStream(InputStream inputStream, OutputStream outputStream, int limit) throws IOException - Throws:
IOException
-