net.sourceforge.dvb.projectx.xinput
Interface XInputFileIF

All Known Implementing Classes:
XInputFile, XInputFileImpl, XInputFileImpl, XInputFileImpl

public interface XInputFileIF


Method Summary
 boolean exists()
          Checks if file exists
 java.lang.Object getConstructorParameter()
           
 FileType getFileType()
          Gets the type of this XInputFile implementation.
 java.io.InputStream getInputStream()
          Get input stream from the file. close() on stream closes XInputFile, too.
 java.io.InputStream getInputStream(long start_position)
          Get input stream from the file. close() on stream closes XInputFile, too.
 java.lang.String getName()
          Get Name of file
 java.lang.String getParent()
          Get Path of parent
 StreamInfo getStreamInfo()
           
 java.lang.String getUrl()
          Get url representation of the object.
 long lastModified()
          Time in milliseconds from the epoch.
 long length()
          Length of file in bytes.
 void randomAccessClose()
           
 long randomAccessGetFilePointer()
           
 void randomAccessOpen(java.lang.String mode)
          Opens XInputFile for random access
 int randomAccessRead()
           
 int randomAccessRead(byte[] aBuffer)
           
 int randomAccessRead(byte[] aBuffer, int aOffset, int aLength)
           
 java.lang.String randomAccessReadLine()
           
 long randomAccessReadLong()
           
 void randomAccessSeek(long aPosition)
           
 void randomAccessSingleRead(byte[] aBuffer, long aPosition)
          Convinience method for a single random read access to a input file.
 void randomAccessWrite(byte[] aBuffer)
           
 boolean rename()
          rename file
 void setConstructorParameter(java.lang.Object obj)
           
 boolean setLastModified()
          set Time in milliseconds from the epoch.
 void setStreamInfo(StreamInfo _streamInfo)
           
 java.lang.String toString()
          Get String representation of the object.
 

Method Detail

toString

public java.lang.String toString()
Get String representation of the object.
Overrides:
toString in class java.lang.Object
Returns:
String representation of the object

setConstructorParameter

public void setConstructorParameter(java.lang.Object obj)

getConstructorParameter

public java.lang.Object getConstructorParameter()

getFileType

public FileType getFileType()
Gets the type of this XInputFile implementation.
Returns:
FileType

getUrl

public java.lang.String getUrl()
Get url representation of the object.
Returns:
String with url

length

public long length()
Length of file in bytes.
Returns:
Length of file in bytes

lastModified

public long lastModified()
Time in milliseconds from the epoch.
Returns:
Time in milliseconds from the epoch

setLastModified

public boolean setLastModified()
set Time in milliseconds from the epoch.
Returns:
success

exists

public boolean exists()
Checks if file exists
Returns:
Result of check

getName

public java.lang.String getName()
Get Name of file
Returns:
Name of file

getParent

public java.lang.String getParent()
Get Path of parent
Returns:
Path of parent

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.FileNotFoundException,
                                          java.net.MalformedURLException,
                                          java.io.IOException
Get input stream from the file. close() on stream closes XInputFile, too.
Returns:
Input stream from the file

getInputStream

public java.io.InputStream getInputStream(long start_position)
                                   throws java.io.FileNotFoundException,
                                          java.net.MalformedURLException,
                                          java.io.IOException
Get input stream from the file. close() on stream closes XInputFile, too.
Returns:
Input stream from the file

rename

public boolean rename()
               throws java.io.IOException
rename file
Returns:
success

randomAccessOpen

public void randomAccessOpen(java.lang.String mode)
                      throws java.io.IOException
Opens XInputFile for random access
Parameters:
mode - Access mode as in RandomAccessFile
Throws:
java.io.IOException -  

randomAccessClose

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

randomAccessSeek

public void randomAccessSeek(long aPosition)
                      throws java.io.IOException
Parameters:
aPosition - The offset position, measured in bytes from the beginning of the file, at which to set the file pointer.
Throws:
java.io.IOException -  

randomAccessGetFilePointer

public long randomAccessGetFilePointer()
                                throws java.io.IOException
Returns:
@throws IOException

randomAccessRead

public int randomAccessRead()
                     throws java.io.IOException
Returns:
@throws IOException

randomAccessRead

public int randomAccessRead(byte[] aBuffer)
                     throws java.io.IOException
Parameters:
aBuffer - The buffer into which the data is read.
Returns:
@throws java.io.IOException

randomAccessRead

public int randomAccessRead(byte[] aBuffer,
                            int aOffset,
                            int aLength)
                     throws java.io.IOException
Parameters:
aBuffer - The buffer into which the data is written.
aOffset - The offset at which the data should be written.
aLength - The amount of data to be read.
Returns:
@throws IOException

randomAccessReadLine

public java.lang.String randomAccessReadLine()
                                      throws java.io.IOException
Returns:
Read line
Throws:
java.io.IOException -  

randomAccessWrite

public void randomAccessWrite(byte[] aBuffer)
                       throws java.io.IOException
Parameters:
aBuffer - The data.
Throws:
java.io.IOException -  

randomAccessSingleRead

public void randomAccessSingleRead(byte[] aBuffer,
                                   long aPosition)
                            throws java.io.IOException
Convinience method for a single random read access to a input file. The file is opened before and closed after read.
Parameters:
aBuffer - Buffer to fill with read bytes (up to aBuffer.length() bytes)
aPosition - Fileposition at which we want read
Throws:
java.io.IOException -  

randomAccessReadLong

public long randomAccessReadLong()
                          throws java.io.IOException
Returns:
Long value read.
Throws:
java.io.IOException -  

setStreamInfo

public void setStreamInfo(StreamInfo _streamInfo)

getStreamInfo

public StreamInfo getStreamInfo()