home *** CD-ROM | disk | FTP | other *** search
/ Java 1.2 How-To / JavaHowTo.iso / 3rdParty / jbuilder / unsupported / JDK1.2beta3 / SOURCE / SRC.ZIP / java / sql / BlobLocator.java < prev    next >
Encoding:
Java Source  |  1998-03-20  |  1.3 KB  |  55 lines

  1. /*
  2.  * @(#)BlobLocator.java    1.3 98/03/18
  3.  *
  4.  * Copyright 1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  *
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.sql;
  16.  
  17. import java.io.InputStream;
  18.  
  19. /**
  20.  * JDBC 2.0
  21.  *
  22.  * <p>A BlobLocator is a transaction duration reference to a binary large 
  23.  * object in the DBMS server.
  24.  */
  25.  
  26. public interface BlobLocator {
  27.  
  28.   /**
  29.   * The length of the Binary Large Object in bytes.
  30.   *
  31.   * @return length of the BLOB in bytes
  32.   */
  33.   long length();
  34.  
  35.   /**
  36.   * Return copy of the substring of the BLOB at the requested 
  37. รกรก* position.
  38.   *
  39.   * @param pos is the first byte of the substring to be extracted.
  40.   * @param length is the number of consecutive bytes to be copied.
  41.   *
  42.   * @return a byte array containing a substring of the BLOB
  43.   */
  44.   byte[] getBytes(int pos, int length); 
  45.  
  46.   /**
  47.   * Retrieve the entire BLOB as a stream.
  48.   *
  49.   * @return a stream containing the BLOB data
  50.   */
  51.   InputStream getBinaryStream ();
  52. }
  53.  
  54.  
  55.