Skip Headers

Oracle® interMedia Annotator User's Guide
Release 9.2
Part No. A96120-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Previous Next

7
Annotator Parser API Reference Information

This chapter contains reference material for the classes, constructors, and methods that inexperienced users will need to write a custom Annotator parser. See the Javadoc included with the interMedia Annotator installation for complete reference information.

To create a custom parser, in addition to using this API to create a Java class, you must write a parser descriptor XML file and add it to the following directory:

For an example of a parser descriptor XML file, see Chapter 6 and the AuParser.xml file in the parsers directory.


Class oracle.ord.media.annotator.descriptors.AnnotationDesc

This section presents reference information on the methods of the AnnotationDesc class, which creates annotation descriptor objects. This class provides the attribute definitions of the annotation. This class of methods is intended for advanced users (those who write or add parsers to interMedia Annotator).

This class extends oracle.ord.media.annotator.descriptors.Descriptor.


getAncestors( )

Format

public java.util.Vector getAncestors( )

Description

Gets the parent annotations of the current annotation.

Parameters

None.

Return Value

This method returns a Vector object that contains the parent annotations of the current annotation.

Exceptions

None.

Example

None; only advanced users should call this method directly.


getAttributeDesc( )

Format

public AttributeDesc getAttributeDesc(java.lang.String szAttributeName)

Description

Gets the attribute descriptor for the given attribute.

Parameters

szAttributeName

The name of the attribute for which you want to get the attribute descriptor.

Return Value

This method returns the attribute descriptor of the given attribute, as an AttributeDesc object.

Exceptions

None.

Example

None; only advanced users should call this method directly.


getSuppAttributes( )

Format

public java.util.Enumeration getSuppAttributes( )

Description

Gets the supported attribute descriptions defined in the annotation type.

Parameters

None.

Return Value

This method returns an Enumeration object that contains the supported attribute descriptions defined in the annotation type, as AttributeDesc objects.

Exceptions

None.

Example

None; only advanced users should call this method directly.


Class oracle.ord.media.annotator.descriptors.ParserDesc

This section presents reference information on the methods of the ParserDesc class, which creates parser descriptor objects. This class provides the definitions of the operations defined by the parsers, their parameters, their options, and the option parameters. This class of methods is intended for advanced users (those who write or add parsers to interMedia Annotator).

This class extends oracle.ord.media.annotator.descriptors.Descriptor.


getOperationDesc( )

Format

public OperationDesc getOperationDesc(java.lang.String szOpName)

Description

Gets the operation descriptor of the given operation.

Parameters

szOpName

The name of the operation whose descriptor will be returned.

Return Value

This method returns the operation descriptor of the given operation, as an OperationDesc object.

Exceptions

None.

Example

None; only advanced users should call this method directly.


getOperations( )

Format

public java.util.Enumeration getOperations( )

Description

Gets the descriptions of the operations supported by the parser, as defined in the parser descriptor.

Parameters

None.

Return Value

This method returns an Enumeration object that contains the descriptions of the operations supported by the parser, as OperationDesc objects.

Exceptions

None.

Example

None; only advanced users should call this method directly.


isEnabledAndExecutable( )

Format

public boolean isEnabledAndExecutable(java.lang.szOpName)

Description

Checks that the given operation is enabled and executable.

Parameters

szOpName

The name of the operation to check.

Return Value

This method returns true if the method is enabled and executable; false otherwise.

Exceptions

oracle.ord.media.annotator.descriptors.DescriptorException

Example

None; only advanced users should call this method directly.


Class oracle.ord.media.annotator.handlers.AnnTaskManager

This section presents reference information on the constructor and methods of the AnnTaskManager class, which creates an annotation task manager. The annotation task manager object is one of the components involved in monitoring tasks as they are being performed by an AnnotationHandler object (or annotation handler). Whenever a task is started by an annotation handler, an annotation task manager and an annotation task monitor are created. The annotation task manager runs on the server side; it tracks the progress of the task on the database server. The annotation task monitor runs on the client side; it tracks the progress value and messages from the returned annotation task monitor instance through a task progress monitor.

For more information on the annotation task monitor, see "Class oracle.ord.media.annotator.handlers.AnnTaskMonitor".

This class extends java.lang.Object.

This class contains the following fields:


AnnTaskManager Constructor

Format

public AnnTaskManager( )

Description

Creates an AnnTaskManager object. This constructor is used by the annotation handler to create an annotation task manager when a new task begins.

Parameters

None.

Return Value

None.

Exceptions

None.

Example

AnnTaskManager tskmgr = new AnnTaskManager();

addIterCounter( )

Format

public void addIterCounter(int iIterCounter)

Description

Adds the given number to the counter.

Parameters

iIterCounter

The value to be added to the counter.

Return Value

None.

Exceptions

None.

Example

m_annTaskMan.addIterCounter(4);

decrIterCounter( )

Format

public void decrIterCounter( )

Description

Decreases the value of the counter by one.

Parameters

None.

Return Value

None.

Exceptions

None.

Example

m_annTaskMan.decrIterCounter();

done( )

Format

public void done( )

Description

Signifies that the current task is complete.

Parameters

None.

Return Value

None.

Exceptions

None.

Example

See Section 6.9 for an example of this method.


getIterCounter( )

Format

public int getIterCounter( )

Description

Gets the current value of the counter.

Parameters

None.

Return Value

This method returns the current value of the counter.

Exceptions

None.

Example

int counter = m_annTaskMan.getIterCounter();

getMessage( )

Format

public java.lang.String getMessage( )

Description

Gets the current message of the task progress monitor.

Parameters

None.

Return Value

This method returns the current message of the task progress monitor.

Exceptions

None.

Example

String message = m_annTaskMan.getMessage();

getTaskCurrent( )

Format

public int getTaskCurrent( )

Description

Gets the current value of the task progress monitor.

Parameters

None.

Return Value

This method returns the current value of the task progress monitor.

Exceptions

None.

Example

int progress = m_annTaskMan.getTaskCurrent();

getTaskEnd( )

Format

public int getTaskEnd( )

Description

Gets the ending value of the task progress monitor.

Parameters

None.

Return Value

This method returns the ending value of the task progress monitor.

Exceptions

None.

Example

int end = m_annTaskMan.getTaskEnd();

getTaskStart( )

Format

public int getTaskStart( )

Description

Gets the starting value of the task progress monitor.

Parameters

None.

Return Value

This method returns the starting value of the task progress monitor.

Exceptions

None.

Example

See the isInitialized( ) method for an example of this method.


incrIterCounter( )

Format

public void incrIterCounter( )

Description

Increases the value of the counter by one.

Parameters

None.

Return Value

None.

Exceptions

None.

Example

m_annTaskMan.incrIterCounter();

incrTaskCurrent( )

Format

public void incrTaskCurrent(int iTaskToAdd)

Description

Adds the given value to the current value of the task progress monitor.

Parameters

iTaskToAdd

The amount to add to the current value of the task progress monitor.

Return Value

None.

Exceptions

None.

Example

m_annTaskMan.incrTaskCurrent(4);

isDone( )

Format

public boolean isDone( )

Description

Determines if the current task has been completed.

Parameters

None.

Return Value

This method returns true if the current task has been completed; false otherwise.

Exceptions

None.

Example

if(m_annTaskMan.isDone() == false)

     m_annTaskMan.setIterCounter(0);

isInitialized( )

Format

public boolean isInitialized( )

Description

Determines if the annotation task monitor has been initialized. If it has been initialized, then you will be able to use the getTaskStart( ) and getTaskEnd( ) methods.

Parameters

None.

Return Value

This method returns true if the annotation task monitor has been initialized; false otherwise.

Exceptions

None.

Example

if(m_annTaskMan.isInitialized())

     m_annTaskMan.getTaskStart();

setIterCounter( )

Format

public void setIterCounter(int iIterCounter)

Description

Sets the counter to keep track of an iterative process. When the done( ) method is called, the counter decreases by one. The isDone( ) method returns true if the counter is zero.

Parameters

iIterCounter

The initial value of the counter. The default value is 1.

Return Value

None.

Exceptions

None.

Example

See the isDone( ) method for an example of this method.


setMessage( )

Format

public void setMessage(java.lang.String szMessage)

Description

Sets the message of the task progress monitor.

Parameters

szMessage

The message to be set.

Return Value

None.

Exceptions

None.

Example

m_annTaskMan.setMessage("Parsing AU Header...");

setTask( )

Format

public void setTask(int iTaskStart, int iTaskEnd)

Description

Sets the start and end values of the task progress monitor.

Parameters

iTaskStart

The starting value of the task progress monitor.

iTaskEnd

The ending value of the task progress monitor.

Return Value

None.

Exceptions

None.

Example

See Section 6.7 for an example of this method.


setTaskCurrent(int)

Format

public void setTaskCurrent(int iTaskCurrent)

Description

Sets the current value of the task progress monitor.

Parameters

iTaskCurrent

The value to be set for the task progress monitor.

Return Value

None.

Exceptions

None.

Example

See Section 6.7 for an example of this method.


setTaskCurrent(int, String)

Format

public void setTaskCurrent(int iTaskCurrent, java.lang.String szMessage)

Description

Sets the current value and the message of the task progress monitor.

Parameters

iTaskCurrent

The value to be set for the task progress monitor.

szMessage

The message to be set for the task progress monitor.

Return Value

None.

Exceptions

None.

Example

See Section 6.7 for an example of this method.


Class oracle.ord.media.annotator.handlers.annotation.AnnotationFactory

This section presents reference information on the constructor and methods of the AnnotationFactory class. This class is the factory class for annotations; it contains two subfactories (for parser descriptors and annotation descriptors), which are used to create parsers and annotations. The AnnotationFactory class can also create annotations by name.

This class extends java.lang.Object.


AnnotationFactory Constructor

Format

public AnnotationFactory(oracle.ord.media.annotator.handlers.utils.MimeMap mm)

Description

This constructor deals with the mapping from a MIME type or file extension to an annotation, parser, and a player instance.

Parameters

mm

The MimeMap instance. See "Class oracle.ord.media.annotator.handlers.utils.MimeMap" for more information about the MimeMap object.

Return Value

None.

Exceptions

None.

Example

MimeMap() m_map = new MimeMap();


AnnotationFactory m_annfact = new AnnotationFactory(m_map);


createAnnotationByName( )

Format

public oracle.ord.media.annotator.annotations.Annotation createAnnotationByName(java.lang.String
szAnnName)

Description

Instantiates an annotation by getting the annotation descriptor from the annotation descriptor factory.

Parameters

szAnnName

The name of the new annotation.

Return Value

This method returns a newly created annotation.

Exceptions

oracle.ord.media.annotator.handlers.annotation.AnnotationFactoryException

Example

See Section 3.6 for an example of this method.


Class oracle.ord.media.annotator.parsers.Parser

This section presents reference information on the constructor and methods of the Parser class. This class is the base class for all parsers; you must extend this class to write your own parser. The Parser class is an abstract class that defines the functions that are expected from a parser: parsing metadata, extracting samples, and saving metadata to annotations. You must implement the methods that provide these functions in all subclasses of the Parser class.

The Parser class operates on the basis of an underlying wrapper of a DataInputStream object, which is used to read objects during the parsing process. The Parser object is associated with an annotation instance that is populated with the metadata that the parser finds in the stream. The Parser object is associated with an instance of the AnnTaskManager class that provides progress information related to the parsing of the media data. The Parser object is associated with an AnnotationFactory object to create a subannotation of the associated annotation instance.

This class extends java.lang.Object and contains the following fields:


Parser Constructor

Format

public Parser( )

Description

Creates a new Parser object. Any subclass of the Parser class must have an empty constructor.

Parameters

None.

Return Value

None.

Exceptions

None.

Example

None; the user should not call this constructor directly.


extractSamples( )

Format

public abstract void extractSamples( )

Description

Extracts samples from the current media source and sets the samples in the current annotation instance. The AnnotatorEngine object sets the m_madisResource field and the m_annInst field automatically with the setSource( ) and setAnnotation( ) methods, respectively.

Parameters

None.

Return Value

None.

Exceptions

ParserException

See the Annotator Javadoc for more information.

Example

See Section 6.9 for an example of this method.


parse( )

Format

public abstract void parse( )

Description

Parses the source and extracts the metadata. The AnnotatorEngine object sets the m_madisResource field and the m_annInst field automatically with the setSource( ) and setAnnotation( ) methods, respectively.

After running this method, you should call the saveToAnnotation( ) method to set the metadata in the annotation.

Parameters

None.

Return Value

None.

Exceptions

ParserException

See the Annotator Javadoc for more information.

Example

See Section 6.7 for an example of this method.


saveToAnnotation( )

Format

public abstract void saveToAnnotation( )

Description

Sets the extracted metadata in the annotation in the m_annInst field. The annotation is set by the setAnnotation( ) method automatically before parsing.

You should call this method immediately after parsing the media source; this ensures that the annotation is modified only if parsing is successful.

Parameters

None.

Return Value

None.

Exceptions

None.

Example

See Section 6.7 for an example of this method.


Class oracle.ord.media.annotator.utils.MADataInputStream

This section presents reference information on the constructors and methods of the MADataInputStream class. This class provides methods to read the following types from an input stream:

This class extends java.lang.Object.


MADataInputStream(InputStream, boolean, String, String) Constructor

Format

public MADataInputStream(java.io.InputStream is, boolean bLittleEndian,
java.lang.String szCharEncoding,
java.lang.String mimetype)

Description

Creates an MADataInputStream object and saves the input stream argument for later use. This constructor sets whether the data is in little endian format or big endian format. Integers (short, int, long) of the input stream have the specified endian format.

Parameters

is

The underlying input stream.

bLittleEndian

Whether the data is in little endian format or big endian format. True indicates that the data is in little endian format.

szCharEncoding

The character encoding to be used in reading the input string.

mimetype

The MIME type of the input stream.

Return Value

None.

Exceptions

oracle.ord.media.annotator.AnnotatorException

Example

None; the user should not call this constructor directly.


MADataInputStream(MADataInputStream, boolean, String, String) Constructor

Format

public MADataInputStream(MADataInputStream is, boolean bLittleEndian,
java.lang.String szCharEncoding,
java.lang.String mimetype)

Description

Creates an MADataInputStream object and saves the input stream argument for later use. This constructor sets whether the data is in little endian format or big endian format. Integers (short, int, long) of the input stream have the specified endian.

Parameters

is

The underlying input stream.

bLittleEndian

Whether the data is in little endian format or big endian format. True indicates that the data is in little endian format.

szCharEncoding

The character encoding to be used in reading the input string.

mimetype

The MIME type of the input stream.

Return Value

None.

Exceptions

None.

Example

None; the user should not call this constructor directly.


available( )

Format

public int available( )

Description

Returns the number of bytes that can be read or skipped in this input stream without blocking by the next caller of a method for this input stream.

Parameters

None.

Return Value

This method returns the number of bytes that can be read or skipped without blocking by the next caller.

Exceptions

java.io.IOException

Example

int availbytes = m_madisResource.available();

close( )

Format

public void close( )

Description

Closes the input stream and releases any system resources associated with the stream.

Parameters

None.

Return Value

None.

Exceptions

None.

Example

m_madisResource.close();

isLittleEndian( )

Format

public boolean isLittleEndian( )

Description

Checks to see whether or not the input stream is able to read data that is in the little endian format.

Parameters

None.

Return Value

This method returns true if the stream is able to read little endian data; false otherwise.

Exceptions

None.

Example

See the setLittleEndian( ) method for an example of this method.


mark( )

Format

public void mark(int readLimit)

Description

Marks the current position in the input stream. A subsequent call to the reset( ) method repositions the stream at the last marked position.

Parameters

readLimit

The maximum number of bytes that can be read before the mark position becomes invalid.

Return Value

None.

Exceptions

None.

Example

m_madisResource.mark(5000);

int i = 128;

if(i == m_madisResource(skipBytes(i))

     int data = m_madisResource.readInt();

m_madisResource.reset();

read(byte[ ])

Format

public final int read(byte[ ] b)

Description

Reads some number of bytes from the input stream and stores them in the buffer array b. The number of bytes actually read is returned as an integer. To ensure that some data will always be read into the buffer, this method blocks the next caller until input data is available, end-of-file is detected, or an exception is thrown.

If b is null, a NullPointerException is thrown. If the length of b is 0, then no bytes are read and 0 is returned; otherwise, there is an attempt to read at least 1 byte. If no byte is available because the stream is at end-of-file, the value -1 is returned; otherwise, at least 1 byte is read and stored in b.

Parameters

b

The buffer into which the data will be read.

Return Value

This method returns the number of bytes that were read.

Exceptions

java.io.IOException

Example

byte[ ] buffer = new byte[4000];

m_madisResource.read(buffer);

read(byte[ ], int, int)

Format

public final int read(byte[ ] b, int off, int len)

Description

Reads a number of bytes (up to the value of len) of data from the input stream into an array of bytes. An attempt is made to read as many as len bytes, but a smaller number may be read, possibly 0. The number of bytes actually read is returned as an integer.

If len is 0, then no bytes are read and 0 is returned; otherwise, there is an attempt to read at least 1 byte. If no byte is available because the stream is at end-of-file, the value -1 is returned; otherwise, at least 1 byte is read and stored into the array.

To ensure that some data will always be read into the buffer, this method blocks the next caller until input data is available, end-of-file is detected, or an exception is thrown.

If b is null, a NullPointerException is thrown. If the value of off is negative, or len is negative, or off+len is greater than the length of the array b, then an IndexOutOfBoundsException is thrown. If the first byte cannot be read for any reason other than end-of-file, then an IOException is thrown. In particular, an IOException is thrown if the input stream has been closed.

Parameters

b

The buffer into which the data will be read.

off

The offset from the beginning of the buffer at which the data will be read.

len

The maximum number of bytes to be read.

Return Value

This method returns the number of bytes that were read.

Exceptions

java.io.IOException

Example

byte[ ] buffer = new byte[4000];

m_madisResource.read(buffer,64,128);

readAVILanguage( )

Format

public AVILanguage readAVILanguage( )

Description

Reads the next AVI language code in the underlying input stream.

See the Annotator Javadoc for more information about the AVILanguage class.

Parameters

None.

Return Value

This method returns the AVI language code that was read from the input stream.

Exceptions

java.io.IOException

Example

AVILanguageCode code = m_madisResource.readAVILanguage();

readByte( )

Format

public byte readByte( )

Description

Reads the next byte from the input stream.

Parameters

None.

Return Value

This method returns the byte that was read from the input stream.

Exceptions

java.io.IOException

Example

byte b = m_madisResource.readByte();

readByteArray(byte[ ], int)

Format

public int readByteArray(byte[ ] bBuffer, int iNumBytesToRead)

Description

Reads the given number of bytes from the underlying data input stream into the given byte array.

Parameters

bBuffer

The byte array into which the data will be read.

iNumBytesToRead

The number of bytes to be read.

Return Value

This method returns the number of bytes that were read.

Exceptions

java.io.IOException

Example

int i = 256;

byte[ ] b = new byte[i];

if(i == m_madisResource.readByteArray(b,i))

     System.out.println("Read successful");

readByteArray(int)

Format

public byte[ ] readByteArray(int iNumBytesToRead)

Description

Reads the given number of bytes from the underlying data input stream into a byte array.

Parameters

iNumBytesToRead

The number of bytes to be read.

Return Value

This method returns the byte array that was read.

Exceptions

java.io.IOException

Example

int i = 256;

byte[ ] b = new byte[i];

b = m_madisResource.readByteArray(i);

readColor48( )

Format

public long readColor48( )

Description

Reads 6 bytes from the data stream and returns a value in the primitive type long that represents the color in RGB format.

This is used for the QuickTime file format.

Parameters

None.

Return Value

This method returns the value of the color in RGB format in the primitive type long.

Exceptions

java.io.IOException

Example

long RGB = m_madisResource.readColor48();

readDate( )

Format

public java.util.Date readDate( )

Description

Reads the next java.util.Date object from the underlying input stream.

Parameters

None.

Return Value

This method returns the java.util.Date object that was read from the input stream.

Exceptions

java.io.IOException

Example

java.util.Date date = m_madisResource.readDate();

readDate(int, String)

Format

public java.util.Date readDate(int iLen, java.lang.String szPattern)

Description

Returns the bytes read from the data stream as a java.util.Date object, using the given named pattern.

Parameters

iLen

The number of bytes to be read.

szPattern

The date pattern of the bytes, following the specification of java.text.SimpleDateFormat.

Return Value

This method returns a java.util.Date object that was read.

Exceptions

java.io.IOException

Example

java.util.Date date = m_madisResource.readDate(13,"yyyy.MM.dd hh:mm a")

readExtended( )

Format

public Extended readExtended( )

Description

Reads the next 80-bit, extended floating-point number in the underlying input stream.

See the Annotator Javadoc for more information about the Extended class.

Parameters

None.

Return Value

This method returns the 80-bit, extended floating-point number that was read from the input stream.

Exceptions

java.io.IOException

Example

Extended number = m_madisResource.readExtended();

readFixedPoint16( )

Format

public FixedPoint16 readFixedPoint16( )

Description

Reads the next 16-bit, fixed-point number in the underlying input stream.

See the Annotator Javadoc for more information about the FixedPoint16 class.

Parameters

None.

Return Value

This method returns the 16-bit, fixed-point number that was read from the input stream.

Exceptions

java.io.IOException

Example

FixedPoint16 number = m_madisResource.readFixedPoint16();

readFixedPoint32( )

Format

public FixedPoint32 readFixedPoint32( )

Description

Reads the next 32-bit, fixed-point number in the underlying input stream.

See the Annotator Javadoc for more information about the FixedPoint32 class.

Parameters

None.

Return Value

This method returns the 32-bit, fixed-point number that was read from the input stream.

Exceptions

java.io.IOException

Example

FixedPoint32 number = m_madisResource.readFixedPoint32();

readFourCC( )

Format

public FourCC readFourCC( )

Description

Reads the next Four Character Code in the underlying input stream.

See the Annotator Javadoc for more information about the FourCC class.

Parameters

None.

Return Value

This method returns the Four Character Code that was read from the input stream.

Exceptions

java.io.IOException

Example

FourCC code = m_madisResource.readFourCC();

readInt( )

Format

public int readInt( )

Description

Reads the next int from the input stream.

Parameters

None.

Return Value

This method returns the int that was read from the input stream.

Exceptions

None.

Example

See the mark( ) method for an example of this method.


readLong( )

Format

public long readLong( )

Description

Reads the next primitive type long from the underlying input stream.

Parameters

None.

Return Value

This method returns the value of the primitive type long that was read from the input stream.

Exceptions

java.io.IOException

Example

long number = m_madisResource.readLong();

readPascalString( )

Format

public java.lang.String readPascalString( )

Description

Reads the next Pascal string from the underlying input stream and returns the contents of the Pascal string as a Java String object.

Parameters

None.

Return Value

This method returns the contents of the Pascal string, as a Java String object.

Exceptions

java.io.IOException

Example

String pascal = m_madisResource.readPascalString();

readPascalString(int)

Format

public java.lang.String readPascalString(int iNumBytesToRead)

Description

Reads the next Pascal string from the underlying input stream and returns the contents of the Pascal string as a Java String object.

Parameters

iNumBytesToRead

The number of bytes to read from the input stream.

Return Value

This method returns the contents of the Pascal string, as a Java String object.

Exceptions

java.io.IOException

Example

String pascal = m_madisResource.readPascalString(32);

readPascalString(Short)

Format

public java.lang.String readPascalString(java.lang.Short sLengthSize)

Description

Reads the next enhanced Pascal string from the underlying input stream and returns the contents of the Pascal string as a Java String object.

An enhanced Pascal string is a Pascal string with a string length of 8, 16, or 32 bits set at the beginning, followed by the contents of the string. The length must be 8, 16, or 32 bits.

Parameters

sLengthSize

The number of bits in the string. It must be 8, 16, or 32.

Return Value

This method returns the contents of the Pascal string, as a Java String object.

Exceptions

java.io.IOException

Example

String pascal = m_madisResource.readPascalString(32);

readQTLanguage( )

Format

public QTLanguage readQTLanguage( )

Description

Reads the next QuickTime language code from the underlying input stream.

See the Annotator Javadoc for more information about the QTLanguage object.

Parameters

None.

Return Value

This method returns the QuickTime language code that was read from the input stream.

Exceptions

java.io.IOException

Example

QTLanguage code = m_madisResource.readQTLanguage();

readRectangle( )

Format

public Rectangle readRectangle( )

Description

Reads 8 bytes of data from the input stream, which are interpreted as the coordinates of a rectangle.

This is used for the QuickTime and RIFF data formats.

Parameters

None.

Return Value

This method returns the 8 bytes that were read from the input stream, as a Rectangle object.

Exceptions

java.io.IOException

Example

Rectangle size = m_madisResource.readRectangle();

readShort( )

Format

public short readShort( )

Description

Reads the next primitive type short in the underlying input stream.

Parameters

None.

Return Value

This method returns the value of the primitive type short that was read from the input stream.

Exceptions

None.

Example

short number = m_madisResource.readShort();

readString( )

Format

public java.lang.String readString(int iNumBytesToRead)

Description

Reads the given number of bytes from the underlying input stream and formats them as a String.

Parameters

iNumBytesToRead

The number of bytes to be read.

Return Value

This method returns the String that was read from the input stream.

Exceptions

java.io.IOException

Example

String info = m_madisResource.readString(24);

readUnsignedByte( )

Format

public int readUnsignedByte( )

Description

Reads the next unsigned byte from the underlying input stream.

Parameters

None.

Return Value

This method returns the unsigned byte that was read from the input stream object.

Exceptions

java.io.IOException

Example

int number = m_madisResource.readUnsignedByte();

readUnsignedInt( )

Format

public long readUnsignedInt( )

Description

Reads the next unsigned int from the underlying input stream.

Parameters

None.

Return Value

This method returns the unsigned int that was read from the input stream.

Exceptions

java.io.IOException

Example

long number = m_madisResource.readUnsignedInt();

readUnsignedShort( )

Format

public int readUnsignedShort( )

Description

Reads the next unsigned short from the underlying input stream.

Parameters

None.

Return Value

This method returns the short that was read from the input stream.

Exceptions

java.io.IOException

Example

int number = m_madisResource.readUnsignedShort();

reset( )

Format

public void reset( )

Description

Repositions the underlying input stream to the point at which the last mark was placed.

Parameters

None.

Return Value

None.

Exceptions

java.io.IOException

Example

See the mark( ) method for an example of this method.


setLittleEndian( )

Format

public void setLittleEndian(boolean bLittleEndian)

Description

Sets whether or not the input stream can read data that is stored in little endian format.

Parameters

bLittleEndian

Determines whether or not the stream can read data that is stored in little endian format.

Return Value

None.

Exceptions

None.

Example

if(m_madisResource.isLittleEndian())

     m_madisResource.setLittleEndian(false);

skipBytes(int)

Format

public int skipBytes(int iNum)

Description

Skips the given number of bytes in the underlying input stream.

Parameters

iNum

The number of bytes to be skipped.

Return Value

This method returns the number of bytes to be skipped.

Exceptions

java.io.IOException

Example

See the mark( ) method for an example of this method.


skipBytes(long)

Format

public long skipBytes(long iNum)

Description

Skips the given number of bytes in the underlying input stream.

Parameters

iNum

The number of bytes to be skipped.

Return Value

This method returns the number of bytes skipped.

Exceptions

java.io.IOException

Example

long number = 256;

if(number == m_madisResource.skipBytes(number)

     int data = m_madisResource.readInt();



Previous Next
Oracle Logo
Copyright © 1999,  2002 Oracle Corporation

All rights reserved
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback