Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.ifs.server.renderers
Class InMemoryRandomAccessContent

    java.lang.Object
      oracle.ifs.server.renderers.InMemoryRandomAccessContent

All Implemented Interfaces:
  RandomAccessContentInterface

    public class InMemoryRandomAccessContent

extends java.lang.Object
implements RandomAccessContentInterface

InMemoryRandomAccessContent is an RandomAccessContentInterface object which stores its data as an array of bytes, keeping the all the data in memory. InMemoryRandomAccessContent are never writeable.

(Unpublished)

Constructor Summary
`InMemoryRandomAccessContent(byte[] bytes, boolean mustCopy)` Creates a InMemoryRandomAccessContent from an array of bytes.
`InMemoryRandomAccessContent(java.io.InputStream is)` Creates an InMemoryRandomAccessContent from an InputStream.

Method Summary
`boolean` | `canWrite()` Always returns false
`void` | `close()` Release used memory
`void` | `dispose()` Releases used memory
`void` | `flush()` Throws IfsException 32236
`long` | `getLength()` returns the length of this content object.
`int` | `read(long fOffset, byte[] buf, int bOffset, int length)` read length bytes from file offset, filling buffer starting at boffset.
`void` | `truncate(long offset)` Throws IfsException 32236
`void` | `write(long fOffset, byte[] buf, int bOffset, int length)` Throws IfsException 32236

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

Constructor Detail

### InMemoryRandomAccessContent

    public InMemoryRandomAccessContent(byte[] bytes,
                                       boolean mustCopy)

  Creates a InMemoryRandomAccessContent from an array of bytes.

  Parameters:
    `bytes` - The bytes which compose the content of the object
    `mustCopy` - If true, then the byte array passed in must be copied. Otherwise, the passed-in bytes array is used directly.

### InMemoryRandomAccessContent

    public InMemoryRandomAccessContent(java.io.InputStream is)
                                throws java.io.IOException

  Creates an InMemoryRandomAccessContent from an InputStream. Copies the stream's contents into memory.

  Parameters:
    `is` - The stream to use as input.
  Throws:
    `java.io.IOException` - thrown if an error occured reading the stream

Method Detail

### read

    public int read(long fOffset,
                    byte[] buf,
                    int bOffset,
                    int length)

  Description copied from class: `InMemoryRandomAccessContent`
  read length bytes from file offset, filling buffer starting at boffset. Both Offsets are zero based.

  Specified by:
    `read` in interface `RandomAccessContentInterface`
  Parameters:
    `fOffset` - offset at which to begin reading.
    `buf` - the byte array into which data is to be read
    `bOffset` - the offset into the buffer
    `length` - the amount of data to read.
  Returns:
    number of bytes actually read.

### write

    public void write(long fOffset,
                      byte[] buf,
                      int bOffset,
                      int length)
               throws IfsException

  Description copied from class: `InMemoryRandomAccessContent`
  Throws IfsException 32236

  Specified by:
    `write` in interface `RandomAccessContentInterface`
  Parameters:
    `fOffset` - offset at which to begin writing.
    `buf` - the byte array containing the data to be written
    `bOffset` - the offset into the buffer to begin writing from
    `length` - the amount of data to write
  Throws:
    `IfsException` - if operation fails

### truncate

    public void truncate(long offset)
                  throws IfsException

  Description copied from class: `InMemoryRandomAccessContent`
  Throws IfsException 32236

  Specified by:
    `truncate` in interface `RandomAccessContentInterface`
  Parameters:
    `offset` - offset at which to truncate.
  Throws:
    `IfsException` - if operation fails

### flush

    public void flush()
               throws IfsException

  Description copied from class: `InMemoryRandomAccessContent`
  Throws IfsException 32236

  Specified by:
    `flush` in interface `RandomAccessContentInterface`
  Throws:
    `IfsException` - if operation fails

### close

    public void close()
               throws IfsException

  Description copied from class: `InMemoryRandomAccessContent`
  Release used memory

  Specified by:
    `close` in interface `RandomAccessContentInterface`
  Throws:
    `IfsException` - if operation fails

### dispose

    public void dispose()
                 throws IfsException

  Description copied from class: `InMemoryRandomAccessContent`
  Releases used memory

  Specified by:
    `dispose` in interface `RandomAccessContentInterface`
  Throws:
    `IfsException` - if operation fails

### canWrite

    public boolean canWrite()

  Description copied from class: `InMemoryRandomAccessContent`
  Always returns false

  Specified by:
    `canWrite` in interface `RandomAccessContentInterface`

### getLength

    public long getLength()

  Description copied from class: `InMemoryRandomAccessContent`
  returns the length of this content object.

  Specified by:
    `getLength` in interface `RandomAccessContentInterface`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD