com.wowza.io
Interface IRandomAccessReader


public interface IRandomAccessReader


Field Summary
static int FORWARD
           
static int REVERSE
           
 
Method Summary
 void close()
          Close the media asset
 boolean exists()
          Does the media asset exist
 String getBasePath()
          Get the basePath for the random access reader
 int getDirecton()
          Get the current direction hint for the random access reader.
 long getFilePointer()
          Get the current byte location in the media asset
 String getMediaExtension()
          Get the media extension
 String getMediaName()
          Get the media name
 String getPath()
          Get the unique path to the media asset item
 void init(IApplicationInstance appInstance, IMediaStream stream, String basePath, String mediaName, String mediaExtension)
          Intialize RandomAccessReader
 boolean isOpen()
          Is the media asset open
 long lastModified()
          Return the lastModified date (same format as File.lastModified)
 long length()
          Get the media asset length in bytes
 void open()
          Open the media asset
 int read(byte[] buf, int off, int size)
          Read bytes from the media asset
 void seek(long pos)
          Seek to a position in the media asset
 void setDirecton(int directon)
          Set the current direction hint
 

Field Detail

FORWARD

static final int FORWARD
See Also:
Constant Field Values

REVERSE

static final int REVERSE
See Also:
Constant Field Values
Method Detail

close

void close()
           throws java.io.IOException
Close the media asset

Throws:
java.io.IOException

exists

boolean exists()
Does the media asset exist

Returns:
true if media assets exists

getBasePath

String getBasePath()
Get the basePath for the random access reader

Returns:
basePath for the random access reader

getDirecton

int getDirecton()
Get the current direction hint for the random access reader. The underlying system will call setDirection to hint at the current direction the media assets is being read.

Returns:
current direction hint for the random access reader

getFilePointer

long getFilePointer()
Get the current byte location in the media asset

Returns:
current byte location in the media asset

getMediaExtension

String getMediaExtension()
Get the media extension

Returns:
media extension

getMediaName

String getMediaName()
Get the media name

Returns:
media name

getPath

String getPath()
Get the unique path to the media asset item

Returns:
unique path to the media asset item

init

void init(IApplicationInstance appInstance,
          IMediaStream stream,
          String basePath,
          String mediaName,
          String mediaExtension)
Intialize RandomAccessReader

Parameters:
appInstance - application instance
stream - parent stream if one exists
basePath - basePath for IApplicationInstance
mediaName - media name
mediaExtension - media extension from mediaReaders

isOpen

boolean isOpen()
Is the media asset open

Returns:
true if media asset is open

lastModified

long lastModified()
Return the lastModified date (same format as File.lastModified)

Returns:
lastModified date (same format as File.lastModified)

length

long length()
Get the media asset length in bytes

Returns:
media asset length in bytes

open

void open()
          throws java.io.IOException
Open the media asset

Throws:
java.io.IOException

read

int read(byte[] buf,
         int off,
         int size)
Read bytes from the media asset

Parameters:
buf - buffer to fill
off - offset in buffer
size - size of block to read
Returns:
number of bytes read, -1 if failure

seek

void seek(long pos)
Seek to a position in the media asset

Parameters:
pos - position to seek to

setDirecton

void setDirecton(int directon)
Set the current direction hint

Parameters:
directon - current direction hint for the random access reader