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

BfileInputStream Object

This section presents reference information on the methods associated with the BfileInputStream object, which provides an interface for JAI to read data from BFILEs. It is a subclass of com.sun.media.jai.codec.SeekableStream and java.io.InputStream; it implements java.io.DataInput.

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


BfileInputStream(BFILE)

Format

public BfileInputStream(oracle.sql.BFILE bfile)

Description

Creates a BfileInputStream object that reads from the specified BFILE. The constructor uses the maximum chunk size defined for a BFILE. The BFILE will be opened after this constructor executes.

Parameters

bfile

The BFILE from which data will be read.

Return Value

None.

Exceptions

java.io.IOException

java.sql.SQLException

Examples

None.


BfileInputStream(BFILE, int)

Format

public BfileInputStream(oracle.sql.BFILE bfile, int chunkSize)

Description

Creates a BfileInputStream object that reads from the specified BFILE. The constructor uses the specified chunk size. The BFILE will be opened after this constructor executes.

Parameters

bfile

The BFILE from which data will be read.

chunkSize

The maximum amount of data to read from the BFILE at one time.

Return Value

None.

Exceptions

java.io.IOException

java.sql.SQLException

Examples

None.


canSeekBackwards( )

Format

public boolean canSeekBackwards( )

Description

Checks whether or not the stream can read backwards. Because the BfileInputStream object can read backwards, this method will always return true.

Parameters

None.

Return Value

This method returns true.

Exceptions

None.

Examples

None.


close( )

Format

public void close( )

Description

Closes the BfileInputStream object, releasing any resources being used. The BFILE automatically closes after the stream closes.

Parameters

None.

Return Value

None.

Exceptions

java.io.IOException

Examples

None.


getBFILE( )

Format

public oracle.sql.BFILE getBFILE( )

Description

Returns the BFILE associated with the BfileInputStream object.

Parameters

None.

Return Value

This method returns the BFILE associated with the BfileInputStream object.

Exceptions

None.

Examples

None.


getFilePointer( )

Format

public long getFilePointer( )

Description

Returns the offset from the beginning of the BFILE at which the next read operation will occur.

Parameters

None.

Return Value

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

Exceptions

java.io.IOException

Examples

None.


mark(int)

Format

public void mark(int readLimit)

Description

Marks the current position in the BfileInputStream object. A call to the reset( ) method will return you to the last marked position in the BfileInputStream object.

Parameters

readLimit

This argument is ignored by the class.

Return Value

None.

Exceptions

None.

Examples

None.


markSupported( )

Format

public boolean markSupported( )

Description

Checks whether or not the BfileInputStream object supports marking. Because the BfileInputStream object supports marking, this method will always return true.

Parameters

None.

Return Value

This method returns true.

Exceptions

None.

Examples

None.


read( )

Format

public int read( )

Description

Reads a single byte from the BFILE associated with the BfileInputStream object.

Parameters

None.

Return Value

This method returns the byte of data that is read, or -1 if the end of the BFILE has been reached.

Exceptions

java.io.IOException

Examples

None.


read(byte[ ])

Format

public int read(byte[ ] buffer)

Description

Reads data from the BFILE into the specified buffer.

Parameters

buffer

The buffer into which the data is read.

Return Value

This method returns the number of bytes read into the buffer, or -1 if the end of the BFILE was reached before any data was read. The value cannot exceed the length of the buffer.

Exceptions

java.io.IOException

Examples

None.


read(byte[ ], int, int)

Format

public int read(byte[ ]buffer, int off, int len)

Description

Reads up to the specified length of data from the BFILE into the specified buffer, starting from the specified offset.

Parameters

buffer

The buffer into which the data is read.

off

The offset from the beginning of the buffer at which data will be written, in bytes.

len

The maximum number of bytes to be read into the buffer.

Return Value

This method returns the number of bytes read, or -1 if the end of the BFILE was reached before any data was read. The value cannot exceed the length of the buffer.

Exceptions

java.io.IOException

Examples

None.


remaining( )

Format

public long remaining( )

Description

Returns the number of unread bytes remaining in the BFILE.

Parameters

None.

Return Value

This method returns the number of unread bytes in the BFILE.

Exceptions

None.

Examples

None.


reset( )

Format

public void reset( )

Description

Repositions the stream to the position of the last valid mark.

Parameters

None.

Return Value

None.

Exceptions

java.io.IOException

Examples

None.


seek(long)

Format

public void seek(long pos)

Description

Sets the offset from the beginning of the BFILE at which the next read operation should occur.

Parameters

pos

The offset from the beginning of the BFILE at which the next read operation should occur.

Return Value

None.

Exceptions

java.io.IOException

Examples

None.


skip(long)

Format

public long skip(long n)

Description

Attempts to skip over the specified number of bytes in the BFILE.

The number of bytes skipped may be smaller than the specified number; for example, the number would be smaller if the end of the file is reached.

Parameters

n

The number of bytes to be skipped.

Return Value

This method returns the number of bytes that are actually skipped.

Exceptions

java.io.IOException

Examples

None.