com.tuneology.avm.media
Interface MediaData

All Known Implementing Classes:
MediaBuffer, AudioData, MediaFile

public interface MediaData

This interface represents a data store with capabilities suitable for holding media data.

Version:
$Id: MediaData.java,v 1.2 2003/03/19 02:26:07 xnarf Exp $
Author:
Fran Taylor

Method Summary
 boolean canSeek()
          Returns true if the file is capable of seeking.
 void close()
           
 java.io.File getFile()
          Returns a File object by which the contents can be read.
 long getFilePointer()
          Returns the current position in the file.
 java.lang.String getPath()
          Returns the pathname of the file if it has one, blank otherwise.
 MediaProperties getProperties()
           
 boolean isStream()
          Returns true if the source is a stream of indefinate length.
 long length()
          Returns the length of the file.
 int read(byte[] b, int off, int len)
           
 void releaseFile(java.io.File f)
          Deletes the contents of the file if it's a temp file.
 void seek(long pos)
          Moves the current position in the file.
 void setLength(long newLength)
           
 void write(byte[] b, int off, int len)
           
 

Method Detail

getFile

public java.io.File getFile()
                     throws java.io.IOException
Returns a File object by which the contents can be read. This can be a temporary file, if necessary. Not allowed if the source is a stream.
Throws:
java.io.IOException -  

releaseFile

public void releaseFile(java.io.File f)
                 throws java.io.IOException
Deletes the contents of the file if it's a temp file.
Throws:
java.io.IOException -  

isStream

public boolean isStream()
Returns true if the source is a stream of indefinate length.
Returns:
true if the source is a stream of indefinate length.

getPath

public java.lang.String getPath()
Returns the pathname of the file if it has one, blank otherwise.
Returns:
the pathname of the file if it has one, blank otherwise.

getProperties

public MediaProperties getProperties()

length

public long length()
            throws java.io.IOException
Returns the length of the file.
Returns:
the length of the file.
Throws:
java.io.IOException -  

canSeek

public boolean canSeek()
Returns true if the file is capable of seeking.

seek

public void seek(long pos)
          throws java.io.IOException
Moves the current position in the file.
Parameters:
pos - the new current position.
Throws:
java.io.IOException -  

getFilePointer

public long getFilePointer()
                    throws java.io.IOException
Returns the current position in the file.
Returns:
the current position in the file.
Throws:
java.io.IOException -  

setLength

public void setLength(long newLength)
               throws java.io.IOException
Parameters:
newLength -  
Throws:
java.io.IOException -  

read

public int read(byte[] b,
                int off,
                int len)
         throws java.io.IOException
Parameters:
b -  
off -  
len -  
Throws:
java.io.IOException -  

write

public void write(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException
Throws:
java.io.IOException -  

close

public void close()
           throws java.io.IOException
Throws:
java.io.IOException -