Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## net.sourceforge.jtds.jdbc
Class BlobImpl

    java.lang.Object
      |
      +--net.sourceforge.jtds.jdbc.BlobImpl

All Implemented Interfaces:
  java.sql.Blob

public class BlobImpl
extends java.lang.Object
implements java.sql.Blob

An in-memory or disk based representation of binary data.

Version:
  $Id: BlobImpl.java,v 1.31 2007/07/08 21:38:13 bheineman Exp $
Author:
  Brian Heineman, Mike Hutchinson

Field Summary
`private BlobBuffer` | `blobBuffer` The underlying `BlobBuffer`.
`private static byte[]` | `EMPTY_BLOB` 0 length `byte[]` as initial value for empty `Blob`s.

Constructor Summary
`(package private)` | `BlobImpl(ConnectionJDBC2 connection)` Constructs a new empty `Blob` instance.
`(package private)` | `BlobImpl(ConnectionJDBC2 connection, byte[] bytes)` Constructs a new `Blob` instance initialized with data.

Method Summary
`java.io.InputStream` | `getBinaryStream()`
`byte[]` | `getBytes(long pos, int length)`
`long` | `length()`
`long` | `position(java.sql.Blob pattern, long start)`
`long` | `position(byte[] pattern, long start)`
`java.io.OutputStream` | `setBinaryStream(long pos)`
`int` | `setBytes(long pos, byte[] bytes)`
`int` | `setBytes(long pos, byte[] bytes, int offset, int len)`
`void` | `truncate(long len)`

Methods inherited from class java.lang.Object
`, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait`

Field Detail

### EMPTY_BLOB

    private static final byte[] EMPTY_BLOB

  0 length `byte[]` as initial value for empty `Blob`s.

### blobBuffer

    private final BlobBuffer blobBuffer

  The underlying `BlobBuffer`.

Constructor Detail

### BlobImpl

    BlobImpl(ConnectionJDBC2 connection)

  Constructs a new empty `Blob` instance.
  Parameters:
    `connection` - a reference to the parent connection object

### BlobImpl

    BlobImpl(ConnectionJDBC2 connection,
             byte[] bytes)

  Constructs a new `Blob` instance initialized with data.
  Parameters:
    `connection` - a reference to the parent connection object
    `bytes` - the blob object to encapsulate

Method Detail

### getBinaryStream

    public java.io.InputStream getBinaryStream()
                                        throws java.sql.SQLException

  Specified by:
    `getBinaryStream` in interface `java.sql.Blob`

### getBytes

    public byte[] getBytes(long pos,
                           int length)
                    throws java.sql.SQLException

  Specified by:
    `getBytes` in interface `java.sql.Blob`

### length

    public long length()
                throws java.sql.SQLException

  Specified by:
    `length` in interface `java.sql.Blob`

### position

    public long position(byte[] pattern,
                         long start)
                  throws java.sql.SQLException

  Specified by:
    `position` in interface `java.sql.Blob`

### position

    public long position(java.sql.Blob pattern,
                         long start)
                  throws java.sql.SQLException

  Specified by:
    `position` in interface `java.sql.Blob`

### setBinaryStream

    public java.io.OutputStream setBinaryStream(long pos)
                                         throws java.sql.SQLException

### setBytes

    public int setBytes(long pos,
                        byte[] bytes)
                 throws java.sql.SQLException

### setBytes

    public int setBytes(long pos,
                        byte[] bytes,
                        int offset,
                        int len)
                 throws java.sql.SQLException

### truncate

    public void truncate(long len)
                  throws java.sql.SQLException

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Generated on August 22 2007