Oracle® interMedia Annotator User's Guide Release 9.2 Part No. A96120-01 |
|
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:
On UNIX:
$ORACLE_HOME/ord/Annotator/lib/descriptors/parsers
On Windows:
ORACLE_HOME\ord\Annotator\lib\descriptors\parsers
For an example of a parser descriptor XML file, see Chapter 6 and the AuParser.xml
file in the parsers
directory.
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.
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.
Format
public AttributeDesc getAttributeDesc(java.lang.String szAttributeName)
Description
Gets the attribute descriptor for the given attribute.
Parameters
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.
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.
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.
Format
public OperationDesc getOperationDesc(java.lang.String szOpName)
Description
Gets the operation descriptor of the given operation.
Parameters
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.
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.
Format
public boolean isEnabledAndExecutable(java.lang.szOpName)
Description
Checks that the given operation is enabled and executable.
Parameters
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.
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:
protected boolean m_bInitialized
protected int m_iIterCounter
protected int m_iTaskCurrent
protected int m_iTaskEnd
protected int m_iTaskStart
protected java.lang.String m_szMessage
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();
Format
public void addIterCounter(int iIterCounter)
Description
Adds the given number to the counter.
Parameters
The value to be added to the counter.
Return Value
None.
Exceptions
None.
Example
m_annTaskMan.addIterCounter(4);
Format
public void decrIterCounter( )
Description
Decreases the value of the counter by one.
Parameters
None.
Return Value
None.
Exceptions
None.
Example
m_annTaskMan.decrIterCounter();
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.
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();
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();
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();
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();
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.
Format
public void incrIterCounter( )
Description
Increases the value of the counter by one.
Parameters
None.
Return Value
None.
Exceptions
None.
Example
m_annTaskMan.incrIterCounter();
Format
public void incrTaskCurrent(int iTaskToAdd)
Description
Adds the given value to the current value of the task progress monitor.
Parameters
The amount to add to the current value of the task progress monitor.
Return Value
None.
Exceptions
None.
Example
m_annTaskMan.incrTaskCurrent(4);
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);
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();
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
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.
Format
public void setMessage(java.lang.String szMessage)
Description
Sets the message of the task progress monitor.
Parameters
The message to be set.
Return Value
None.
Exceptions
None.
Example
m_annTaskMan.setMessage("Parsing AU Header...");
Format
public void setTask(int iTaskStart, int iTaskEnd)
Description
Sets the start and end values of the task progress monitor.
Parameters
The starting value of the task progress monitor.
The ending value of the task progress monitor.
Return Value
None.
Exceptions
None.
Example
See Section 6.7 for an example of this method.
Format
public void setTaskCurrent(int iTaskCurrent)
Description
Sets the current value of the task progress monitor.
Parameters
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.
Format
public void setTaskCurrent(int iTaskCurrent, java.lang.String szMessage)
Description
Sets the current value and the message of the task progress monitor.
Parameters
The value to be set for the task progress monitor.
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.
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.
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
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);
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
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.
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:
protected AnnotationFactory m_annFactory
This is the AnnotationFactory object that is used to create subannotations.
protected oracle.ord.media.annotator.annotations.Annotation m_annInst
This is the annotation that is processed by the parser.
protected AnnTaskManager m_annTaskMan
This is the AnnTaskManager object that is used to produce progress information.
protected boolean m_bExtractable
This determines if the parser can extract samples from the annotation. The default is false.
protected MADataInputStream m_madisResource
This is the media source to be processed.
protected oracle.ord.media.annotator.descriptors.ParserDesc m_pd
This is the in-memory representation of the parser descriptor XML file.
protected oracle.ord.media.annotator.utils.Status m_sStatus
This is the Status object that is used to produce trace information for the application.
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.
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.
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.
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.
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:
16-bit fixed-point numbers
32-bit fixed-point numbers
80-bit extended floating-point numbers
Audio Video Interleaved (AVI) language codes
Date (both as an int and as a formatted string)
Four Character Codes (FourCC)
int (both big endian and little endian)
long (both big endian and little endian)
Pascal string (both variable-sized and fixed-size)
QuickTime language codes
short (both big endian and little endian)
unsigned int (both big endian and little endian)
unsigned long (both big endian and little endian)
unsigned short (both big endian and little endian)
This class extends java.lang.Object.
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
The underlying input stream.
Whether the data is in little endian format or big endian format. True indicates that the data is in little endian format.
The character encoding to be used in reading the input string.
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.
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
The underlying input stream.
Whether the data is in little endian format or big endian format. True indicates that the data is in little endian format.
The character encoding to be used in reading the input string.
The MIME type of the input stream.
Return Value
None.
Exceptions
None.
Example
None; the user should not call this constructor directly.
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();
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();
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.
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
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();
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
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);
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
The buffer into which the data will be read.
The offset from the beginning of the buffer at which the data will be read.
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);
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();
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();
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
The byte array into which the data will be read.
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");
Format
public byte[ ] readByteArray(int iNumBytesToRead)
Description
Reads the given number of bytes from the underlying data input stream into a byte array.
Parameters
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);
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();
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();
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
The number of bytes to be read.
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")
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();
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();
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();
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();
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.
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();
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();
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
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);
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
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);
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();
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();
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();
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
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);
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();
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();
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();
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.
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
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);
Format
public int skipBytes(int iNum)
Description
Skips the given number of bytes in the underlying input stream.
Parameters
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.
Format
public long skipBytes(long iNum)
Description
Skips the given number of bytes in the underlying input stream.
Parameters
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();
|
Copyright © 1999, 2002 Oracle Corporation All rights reserved |
|