Skip Headers

Oracle® interMedia Java Classes Reference
10g Release 1 (10.1)

Part Number B10830-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Feedback

Go to previous page
Previous
Go to next page
Next
View PDF

BlobOutputStream Object

This section presents reference information on the methods associated with the BlobOutputStream object, which provides an interface for JAI to write data to BLOBs. It is a subclass of java.io.OutputStream.

Before running the methods associated with the BlobOutputStream object, the following operations must have already been performed:


BlobOutputStream(BLOB)

Format

public BlobOutputStream (oracle.sql.BLOB blob)

Description

Creates a BlobOutputStream object that writes to the specified BLOB, using an optimal chunk size that is determined by the database. Creating an object of this type implicitly trims the data in the BLOB to a length of zero.

Parameters

blob

The BLOB to which data will be written.

Return Value

None.

Exceptions

java.io.IOException

java.sql.SQLException

Examples

None.


BlobOutputStream(BLOB, int)

Format

public BlobOutputStream(oracle.sql.BLOB blob, int chunkSize)

Description

Creates a BlobOutputStream object that writes to the specified BLOB, using the given integer as the maximum chunk size. Creating an object of this type implicitly trims the data in the BLOB to a length of zero.

Parameters

blob

The BLOB to which data will be written

chunkSize

The maximum amount of data to write to the BLOB at one time.

Return Value

None.

Exceptions

java.io.IOException

java.sql.SQLException

Examples

None.


close( )

Format

public void close( )

Description

Closes the output stream and releases any system resources associated with this stream. Before closing the stream, this method automatically calls the flush( ) method to write any buffered bytes to the BLOB.

Parameters

None.

Return Value

None.

Exceptions

java.io.IOException

Examples

None.


flush( )

Format

public void flush( )

Description

Flushes the output stream and forces any buffered output bytes to be written to the BLOB.

Parameters

None.

Return Value

None.

Exceptions

java.io.IOException

Examples

None.


getFilePointer( )

Format

public long getFilePointer( )

Description

Returns the offset from the beginning of the BLOB at which the next write operation will occur.

Parameters

None.

Return Value

This method returns the offset from the beginning of the BLOB at which the next write operation will occur, in bytes.

Exceptions

java.io.IOException

Examples

None.


length( )

Format

public long length( )

Description

Returns the current length of the output stream.

Parameters

None.

Return Value

This method returns the current length of the output stream.

Exceptions

java.io.IOException

Examples

None.


seek(long)

Format

public void seek(long pos)

Description

Sets the file-pointer offset, measured from the beginning of this stream, at which the next write operation occurs.

The offset may be set beyond the end of the stream. Setting the offset beyond the end of the stream does not change the stream length; the stream length will change only by writing after the offset has been set beyond the end of the stream.

Parameters

pos

The offset position, measured in bytes from the beginning of the stream, at which to set the file pointer.

Return Value

None.

Exceptions

java.io.IOException

Examples

None.


write(byte[ ])

Format

public void write(byte[ ] buffer)

Description

Writes all bytes in the specified byte array to the BLOB.

Parameters

buffer

An array of bytes to be written to the BLOB.

Return Value

None.

Exceptions

java.io.IOException

Examples

None.


write(byte[ ], int, int)

Format

public void write(byte[ ] buffer, int off, int len)

Description

Writes the specified number of bytes from the specified byte array to the BLOB.

Parameters

buffer

The buffer containing the data to be written to the BLOB.

off

The starting position for the offset in the buffer.

len

The number of bytes to write to the BLOB.

Return Value

None.

Exceptions

java.io.IOException

Examples

None.


write(int)

Format

public void write(int b)

Description

Writes the specified byte to the BLOB.

Parameters

b

The byte to be written to the BLOB. Only the low-order byte is written; the upper 24 bits are ignored.

Return Value

None.

Exceptions

java.io.IOException

Examples

None.