Oracle Repository API and Model Reference Guide


Contents


API Methods


Element Definitions


Index  


oracle.repos.services.file
Class ReposFileInputStream

java.lang.Object
  |
  +--java.io.InputStream
        |
        +--oracle.repos.services.file.ReposFileInputStream

public class ReposFileInputStream
extends InputStream

 

Method Summary
 int available()
          Returns the number of bytes that can be read from this input stream without blocking.
 void close()
          Closes this input stream and releases any system resources associated with the stream.
 long getCRC()
          Returns the repository stored crc value associated with the file this stream is connected to.
 long getFileSize()
          Returns the repository stored uncompressed file size.
 long getLobLen()
          Returns the number of bytes actually stored in the repository for this file (the column lob length).
 int getMaxChunkSize()
          Convenience function that returns the FileService max chunk size value.
 Date getTimestamp()
          Returns the repository stored os_timestamp value associated with the file this stream is connected to.
 boolean isCompressed()
          Returns true if the repos file being read is compressed, false otherwise
 void mark(int readlimit)
          NOT SUPPORTED
 boolean markSupported()
          Tests if this input stream supports the mark and reset methods => ALWAYS RETURNS FALSE.
 int read()
          Reads (returns) the next byte of data from this input stream.
 int read(byte[] b)
          Reads up to b.length bytes of data from this input stream into an array of bytes.
 int read(byte[] b, int offset, int len)
          Reads up to len bytes of data from this input stream into an array of bytes.
(package private)  byte[] read(int len)
          Tries to reads up to len bytes of data from this input stream into an array of bytes and returns this array If the file is compressed, this function passes on to the readCompressed() method.
 int readCompressed(byte[] b, int offset, int len)
          Reads up to len bytes of compressed data from this input stream into an array of bytes, adding data to the buffer from offset onwards.
 void reset()
          NOT SUPPORTED
 long skip(long n)
          Skips over and discards n bytes of data from this input stream.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Method Detail

getMaxChunkSize

public int getMaxChunkSize()
Convenience function that returns the FileService max chunk size value. Simply returns the FileService.getMaxChunkSize() value.

getCRC

public long getCRC()
Returns the repository stored crc value associated with the file this stream is connected to.

getTimestamp

public Date getTimestamp()
Returns the repository stored os_timestamp value associated with the file this stream is connected to.

getFileSize

public long getFileSize()
Returns the repository stored uncompressed file size. The actual amount amount of data stored in the repos may be different from this value, if the file is compressed.

getLobLen

public long getLobLen()
Returns the number of bytes actually stored in the repository for this file (the column lob length).

available

public int available()
Returns the number of bytes that can be read from this input stream without blocking. If the file size is less than getMaxChunkSize() bytes, the file size is returned, otherwise getMaxChunkSize().
Overrides:
available in class InputStream

isCompressed

public boolean isCompressed()
Returns true if the repos file being read is compressed, false otherwise

close

public void close()
           throws FileServiceException
Closes this input stream and releases any system resources associated with the stream.
Overrides:
close in class InputStream

mark

public void mark(int readlimit)
NOT SUPPORTED
Overrides:
mark in class InputStream

markSupported

public boolean markSupported()
Tests if this input stream supports the mark and reset methods => ALWAYS RETURNS FALSE.
Overrides:
markSupported in class InputStream

read

public int read()
         throws FileServiceException
Reads (returns) the next byte of data from this input stream. Returns -1 if no more data is available
Overrides:
read in class InputStream

read

public int read(byte[] b)
         throws FileServiceException
Reads up to b.length bytes of data from this input stream into an array of bytes. Returns the number of bytes read, or -1 if no more data is available. This function is not recommended as it involves an array copy.
Overrides:
read in class InputStream

read

public int read(byte[] b,
                int offset,
                int len)
         throws FileServiceException
Reads up to len bytes of data from this input stream into an array of bytes. Buffers any unread data, ready for the next read. If the file is compressed, this function passes on to the readCompressed() method. Returns the number of bytes read, or -1 if no more data is available.
Overrides:
read in class InputStream
Parameters:
b - The byte array buffer the stream data is copied into
offset - The offset from the current stream position from which to read
len - The amount of data (from offset) to read into the buffer. Len should never be > b.length.

read

byte[] read(int len)
      throws FileServiceException
Tries to reads up to len bytes of data from this input stream into an array of bytes and returns this array If the file is compressed, this function passes on to the readCompressed() method. This method provides maximum speed in fetching data from the repository (as there is no System.arraycopy() involved). HOWEVER This method should *NOT* be used in conjunction with the other read methods. If the other read() methods have been used and there is data left in the data cache, this data is returned until the cache is cleared, potentially resulting in less than len bytes being returned, even if available() indicates > len bytes. Returns the array of bytes read which can be upto len in length (depending on the number of bytes available to read), or null if no more data is available.
Parameters:
len - The amount of data (from offset) to read into the buffer. Len should never be > ReposFileInputStream.available().

readCompressed

public int readCompressed(byte[] b,
                          int offset,
                          int len)
                   throws FileServiceException
Reads up to len bytes of compressed data from this input stream into an array of bytes, adding data to the buffer from offset onwards.
Parameters:
b - Input byte[] buffer
offset - The starting offset for data to be placed into the buffer
len - The amount of data to return in the buffer.
Returns:
the number of bytes decompressed, or -1 if there is no more data

reset

public void reset()
NOT SUPPORTED
Overrides:
reset in class InputStream

skip

public long skip(long n)
          throws FileServiceException
Skips over and discards n bytes of data from this input stream. Returns the number of bytes actually skipped. This method is inefficient when the file is compressed, simply reading and discarding the skipped data.
Overrides:
skip in class InputStream

BM0463 - JR0670 - JDev446