Class VarlenaWrapper.Output

  • All Implemented Interfaces:
    Closeable, Flushable, AutoCloseable, VarlenaWrapper
    Enclosing interface:
    VarlenaWrapper

    public static class VarlenaWrapper.Output
    extends OutputStream
    implements VarlenaWrapper
    A class by which Java writes the content of a varlena as an OutputStream. 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 Detail

      • setVerifier

        public void setVerifier​(VarlenaWrapper.Verifier v)
                         throws IOException
        Set the Verifier to be used on content written to this varlena.

        A verifier must be set, either to NoOp or a datatype-specific subclass of Base, before writing can succeed.

        On construction, no verifier is set, so the datatype-specific code can determine whether the NoOp or a specific verifier will be needed. This method can only be called once, so that this class could then be exposed to client code as an OutputStream without allowing the verifier to be changed.

        Throws:
        IOException
      • free

        public void free()
                  throws IOException
        Actually free a VarlenaWrapper.Output.

        close() does not do so, because the typical use of this class is to write to an instance, close it, then let some native code adopt it. If it turns out one won't be adopted and must be freed, use this method.

        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 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.