ariba.util.core
Interface Blob


public interface Blob

Represents a stream based interface to a "binary large-object" (or blob for short.)

In general we cannot assume that large-objects (lobs) are entirely in memory at any point in time, which is why stream based interfaces are provided. The actual lob may be in a file on disk, in a database or even being streamed in from a network connection. This is why all of the methods in this interface throw LobExceptions as connections with these external resources may fail at any time.


Method Summary
 java.io.InputStream getBinaryStream()
          Retrieves the blob instance as a stream.
 byte[] getBytes(long pos, int length)
          Returns as an array of bytes, part or all of the blob.
 long length()
          Returns the number of bytes in the underlying blob object.
 

Method Detail

length

long length()
            throws LobException
Returns the number of bytes in the underlying blob object.

Returns:
length of the blob in bytes
Throws:
LobException - if there is an error accessing the length of the blob

getBytes

byte[] getBytes(long pos,
                int length)
                throws LobException
Returns as an array of bytes, part or all of the blob. The byte array contains up to length consecutive bytes starting at position pos.

Parameters:
pos - the ordinal position of the first byte in the blob value to be extracted; the first byte is at position 0
length - the number of consecutive bytes to be copied
Returns:
a byte array containing up to length consecutive bytes from the blob, starting with the byte at position pos
Throws:
LobException - if there is an error accessing the blob

getBinaryStream

java.io.InputStream getBinaryStream()
                                    throws LobException
Retrieves the blob instance as a stream.

Returns:
a stream containing the blob data
Throws:
LobException - if there is an error accessing the blob


AribaWeb User Interface Development Framework
Copyright © 2000-2014 Ariba, Inc. All Rights Reserved.