Package org.postgresql.util

# Class StreamWrapper

java.lang.Object
org.postgresql.util.StreamWrapper

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`

public final class StreamWrapper extends Object implements Closeable
Wrapper around a length-limited InputStream.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `StreamWrapper(byte[] data, int offset, int length)`
  `StreamWrapper(InputStream stream)`
  `StreamWrapper(InputStream stream, int length)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `byte @Nullable []`
  `getBytes()`
  `int`
  `getLength()`
  `int`
  `getOffset()`
  `InputStream`
  `getStream()`
  `String`
  `toString()`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### StreamWrapper

    public StreamWrapper(byte[] data, int offset, int length)

  - ### StreamWrapper

    public StreamWrapper(InputStream stream, int length)

  - ### StreamWrapper

    public StreamWrapper(InputStream stream) throws PSQLException
    Throws:
      `PSQLException`

- ## Method Details

  - ### getStream

    public InputStream getStream() throws IOException
    Throws:
      `IOException`

  - ### close

    public void close() throws IOException
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `Closeable`
    Throws:
      `IOException`

  - ### getLength

    public int getLength()

  - ### getOffset

    public int getOffset()

  - ### getBytes

    public byte @Nullable [] getBytes()

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`