public class InMemoryRandomAccessContent extends Object implements RandomAccessContentInterface
| Constructor and Description | 
|---|
InMemoryRandomAccessContent(byte[] bytes,
                           boolean mustCopy)
Creates a InMemoryRandomAccessContent from an array of bytes. 
 | 
InMemoryRandomAccessContent(InputStream is)
Creates an InMemoryRandomAccessContent from an InputStream. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
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 
 | 
public InMemoryRandomAccessContent(byte[] bytes,
                                   boolean mustCopy)
bytes - The bytes which compose the content of the objectmustCopy - If true, then the byte array passed in must be copied.
                   Otherwise, the passed-in bytes array is used directly.public InMemoryRandomAccessContent(InputStream is) throws IOException
is - The stream to use as input.IOException - thrown if an error occured reading the streampublic int read(long fOffset,
                byte[] buf,
                int bOffset,
                int length)
read in interface RandomAccessContentInterfacefOffset - offset at which to begin reading.buf - the byte array into which data is to be readbOffset - the offset into the bufferlength - the amount of data to read.public void write(long fOffset,
                  byte[] buf,
                  int bOffset,
                  int length)
           throws IfsException
write in interface RandomAccessContentInterfacefOffset - offset at which to begin writing.buf - the byte array containing the data to be writtenbOffset - the offset into the buffer to begin writing fromlength - the amount of data to writeIfsException - if operation failspublic void truncate(long offset)
              throws IfsException
truncate in interface RandomAccessContentInterfaceoffset - offset at which to truncate.IfsException - if operation failspublic void flush()
           throws IfsException
flush in interface RandomAccessContentInterfaceIfsException - if operation failspublic void close()
           throws IfsException
close in interface RandomAccessContentInterfaceIfsException - if operation failspublic void dispose()
             throws IfsException
dispose in interface RandomAccessContentInterfaceIfsException - if operation failspublic boolean canWrite()
canWrite in interface RandomAccessContentInterfacepublic long getLength()
getLength in interface RandomAccessContentInterfaceCopyright © 2025. All rights reserved.