Class BlobProxy

  • All Implemented Interfaces:
    java.lang.reflect.InvocationHandler

    public class BlobProxy
    extends java.lang.Object
    implements java.lang.reflect.InvocationHandler
    Manages aspects of proxying Blob references for non-contextual creation, including proxy creation and handling proxy invocations. We use proxies here solely to avoid JDBC version incompatibilities.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.sql.Blob generateProxy​(byte[] bytes)
      Generates a BlobImpl proxy using byte data.
      static java.sql.Blob generateProxy​(java.io.InputStream stream, long length)
      Generates a BlobImpl proxy using a given number of bytes from an InputStream.
      java.lang.Object invoke​(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • invoke

        public java.lang.Object invoke​(java.lang.Object proxy,
                                       java.lang.reflect.Method method,
                                       java.lang.Object[] args)
                                throws java.lang.Throwable
        Specified by:
        invoke in interface java.lang.reflect.InvocationHandler
        Throws:
        java.lang.UnsupportedOperationException - if any methods other than Blob.length(), BlobImplementer.getUnderlyingStream(), Blob.getBinaryStream(), Blob.getBytes(long, int), Blob.free(), or toString/equals/hashCode are invoked.
        java.lang.Throwable
      • generateProxy

        public static java.sql.Blob generateProxy​(byte[] bytes)
        Generates a BlobImpl proxy using byte data.
        Parameters:
        bytes - The data to be created as a Blob.
        Returns:
        The generated proxy.
      • generateProxy

        public static java.sql.Blob generateProxy​(java.io.InputStream stream,
                                                  long length)
        Generates a BlobImpl proxy using a given number of bytes from an InputStream.
        Parameters:
        stream - The input stream of bytes to be created as a Blob.
        length - The number of bytes from stream to be written to the Blob.
        Returns:
        The generated proxy.