Package org.postgresql.pljava.internal
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 aResourceOwner
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
VarlenaWrapper.Input.Stream
-
Nested classes/interfaces inherited from interface org.postgresql.pljava.internal.VarlenaWrapper
VarlenaWrapper.Input, VarlenaWrapper.Output, VarlenaWrapper.Verifier
-
-
Method Summary
Modifier and Type Method Description long
adopt(DualState.Key cookie)
Return the varlena address to native code and dissociate the varlena from Java.ByteBuffer
buffer()
void
close()
void
pin()
boolean
pinUnlessReleased()
String
toString()
String
toString(Object o)
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 JavatoString()
method should passthis
).void
unpin()
-
-
-
Method Detail
-
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 interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
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 JavatoString()
method should passthis
).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 interfaceVarlenaWrapper
- 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 interfaceVarlenaWrapper
- Parameters:
cookie
- Capability held by native code.- Throws:
SQLException
-
-