Class VarlenaWrapper.Input

java.lang.Object
org.postgresql.pljava.internal.VarlenaWrapper.Input
All Implemented Interfaces:
Closeable, AutoCloseable, VarlenaWrapper
Enclosing interface:
VarlenaWrapper

public static class VarlenaWrapper.Input extends Object implements VarlenaWrapper
A class by which Java reads the content of a varlena. Associated with a ResourceOwner to bound the lifetime of the native reference; the chosen resource owner must be one that will be released no later than the memory context containing the varlena.
  • Method Details

    • pin

      public void pin() throws SQLException
      Throws:
      SQLException
    • pinUnlessReleased

      public boolean pinUnlessReleased()
    • unpin

      public void unpin()
    • buffer

      public ByteBuffer buffer() throws SQLException
      Throws:
      SQLException
    • close

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

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

      public String toString(Object o)
      Description copied from interface: VarlenaWrapper
      Return a string describing this object in a way useful for debugging, prefixed with the name (abbreviated for comfort) of the class of the object passed in (the normal Java toString() method should pass this).

      Subclasses or consumers are encouraged to call this method and append further details specific to the subclass or consumer. The convention should be that the recursion will stop at some class that will actually construct the abbreviated class name of o and use it to prefix the returned value.

      Specified by:
      toString in interface VarlenaWrapper
      Parameters:
      o - An object whose class name (possibly abbreviated) should be used to prefix the returned string.
      Returns:
      Description of this object.
    • adopt

      public long adopt(DualState.Key cookie) throws SQLException
      Description copied from interface: VarlenaWrapper
      Return the varlena address to native code and dissociate the varlena from Java.
      Specified by:
      adopt in interface VarlenaWrapper
      Parameters:
      cookie - Capability held by native code.
      Throws:
      SQLException