public class RamDiskResource
extends nxm.sys.lib.IOResource
Modifier and Type | Field and Description |
---|---|
DevIce.DmaMap |
map |
MDevIce |
pic |
Constructor and Description |
---|
RamDiskResource() |
Modifier and Type | Method and Description |
---|---|
long |
avail()
get currently available length of resource
|
int |
checkAllocation(int bytes) |
boolean |
close()
close the resource
|
boolean |
delete()
delete the resource
|
boolean |
exists()
Test for the existence of the resource.
|
long |
getLength()
get length of resource
|
long |
getPhysicalAddress() |
nxm.sys.lib.Table |
getStatFS()
Gets statistics of file system that this resource is located on.
|
boolean |
isFile()
Indicates if this resource is a traditional file.
|
boolean |
open()
open the resource
|
int |
read(byte[] buf,
int boff,
int bytes)
read data from resource
|
int |
read(long lbuf,
int boff,
int bytes)
read data from resource
|
boolean |
seek(long offset)
seek to the specified offset in file
|
void |
setURL(java.lang.String str)
Set the URL that this resource points to.
|
java.lang.String |
toString()
Return a printable string containing information about this object.
|
int |
write(byte[] buf,
int boff,
int bytes)
write data to resource
|
int |
write(long lbuf,
int boff,
int bytes)
write data to resource
|
dirToString, getContext, getDir, getEntry, getEntryList, getInputStream, getInstance, getOutputStream, getQualifier, getStateQualifier, getType, getType, getTypeString, getTypeString, getURL, getUrlStream, isContainer, isPipe, isReady, isStream, isStreaming, lastModified, lastModifiedTime, open, read, seek, setContext, setDir, setLength, setQualifiers, setType, write
public MDevIce pic
public DevIce.DmaMap map
public boolean exists()
exists
in class nxm.sys.lib.IOResource
public boolean isFile()
nxm.sys.lib.IOResource
IOResource.isPipe()
(previously (getType() == FILE)
was used).isFile
in class nxm.sys.lib.IOResource
public void setURL(java.lang.String str)
setURL
in class nxm.sys.lib.IOResource
str
- The fully qualified URL of the resource.public boolean open()
open
in class nxm.sys.lib.IOResource
public boolean close()
close
in class nxm.sys.lib.IOResource
public boolean delete()
delete
in class nxm.sys.lib.IOResource
public long getLength()
getLength
in class nxm.sys.lib.IOResource
public boolean seek(long offset)
seek
in class nxm.sys.lib.IOResource
offset
- Current seek offset in bytes (0..N-1).public long avail()
avail
in class nxm.sys.lib.IOResource
public int read(byte[] buf, int boff, int bytes)
read
in class nxm.sys.lib.IOResource
buf
- The byte buffer to read into.boff
- The byte offset into the byte array to start writing at.bytes
- The number of bytes to try to read.CoreIO.ERROR
) on error.public int write(byte[] buf, int boff, int bytes)
write
in class nxm.sys.lib.IOResource
buf
- The byte buffer to write from.boff
- The byte offset into the byte array to start writing from.bytes
- The number of bytes to try to write.public int read(long lbuf, int boff, int bytes)
read
in class nxm.sys.lib.IOResource
lbuf
- Native pointer to buffer.boff
- The offset into buf to start at.bytes
- The number of bytes to try reading.CoreIO.ERROR
) on error.IOResource.read(byte[], int, int)
public int write(long lbuf, int boff, int bytes)
write
in class nxm.sys.lib.IOResource
lbuf
- Native pointer to buffer.boff
- The offset into buf to start at.bytes
- The number of bytes to write out.public java.lang.String toString()
toString
in class java.lang.Object
public int checkAllocation(int bytes)
public long getPhysicalAddress()
public nxm.sys.lib.Table getStatFS()
nxm.sys.lib.IOResource
getStatFS
in class nxm.sys.lib.IOResource