public class IceResource
extends nxm.sys.lib.IOResource
Constructor and Description |
---|
IceResource() |
Modifier and Type | Method and Description |
---|---|
boolean |
close()
close the resource
|
boolean |
delete()
delete the resource
|
boolean |
exists()
test existence of the resource
|
static int |
free_mem(long ptr)
Frees a block memory
|
long |
getDeviceSize()
Getter for size of the array
|
int |
getNumDevs()
Getter for number of disks
|
java.lang.String |
getPath()
Getter for AUX directory
|
nxm.sys.lib.Table |
getStatFS()
Gets statistics of file system that this resource is located on.
|
int |
getStripeSize()
Stripe size getter
|
long |
getTotalLen()
Getter for total file size
|
boolean |
isFile()
Indicates if this resource is a traditional file.
|
static boolean |
load()
load the native libraries
|
static long |
malloc(long size)
Allocates a block of memory
|
boolean |
open()
open the resource
|
int |
read(byte[] buf,
int boff,
int bin)
Read data from resource.
|
int |
read(long lbuf,
int boff,
int bin)
Read into the native pointer at boff.
|
boolean |
seek(long soff)
seek to the specified offset in file
|
void |
setExtend(long ext)
Setter for extend size.
|
void |
setLength(long len)
set length of resource in bytes
|
void |
setURL(java.lang.String str)
Sets the fully qualified URL of the resource.
|
java.lang.String |
toString()
Return a printable string containing information about this object.
|
int |
write(byte[] buf,
int boff,
int bin)
Write data to resource.
|
int |
write(long lbuf,
int boff,
int bin)
Write from native pointer at boff.
|
avail, dirToString, getContext, getDir, getEntry, getEntryList, getInputStream, getInstance, getLength, getOutputStream, getQualifier, getStateQualifier, getType, getType, getTypeString, getTypeString, getURL, getUrlStream, isContainer, isPipe, isReady, isStream, isStreaming, lastModified, lastModifiedTime, open, read, seek, setContext, setDir, setQualifiers, setType, write
public static boolean load()
public boolean exists()
nxm.sys.lib.IOResource
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 boolean delete()
nxm.sys.lib.IOResource
delete
in class nxm.sys.lib.IOResource
public void setURL(java.lang.String str)
nxm.sys.lib.IOResource
setURL
in class nxm.sys.lib.IOResource
str
- The fully qualified URL of the resource.public void setExtend(long ext)
ext
- suggested size for extensionpublic void setLength(long len)
nxm.sys.lib.IOResource
setLength
in class nxm.sys.lib.IOResource
public boolean open()
nxm.sys.lib.IOResource
open
in class nxm.sys.lib.IOResource
public boolean close()
nxm.sys.lib.IOResource
close
in class nxm.sys.lib.IOResource
public int read(byte[] buf, int boff, int bin)
nxm.sys.lib.IOResource
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.bin
- The number of bytes to try to read.CoreIO.ERROR
) on error.public int read(long lbuf, int boff, int bin)
nxm.sys.lib.IOResource
read
in class nxm.sys.lib.IOResource
lbuf
- Native pointer to buffer.boff
- The offset into buf to start at.bin
- The number of bytes to try reading.CoreIO.ERROR
) on error.IOResource.read(byte[], int, int)
public int write(long lbuf, int boff, int bin)
nxm.sys.lib.IOResource
write
in class nxm.sys.lib.IOResource
lbuf
- Native pointer to buffer.boff
- The offset into buf to start at.bin
- The number of bytes to write out.public int write(byte[] buf, int boff, int bin)
nxm.sys.lib.IOResource
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.bin
- The number of bytes to try to write.public boolean seek(long soff)
seek
in class nxm.sys.lib.IOResource
soff
- Current seek offset in bytes (0..N-1).public nxm.sys.lib.Table getStatFS()
nxm.sys.lib.IOResource
getStatFS
in class nxm.sys.lib.IOResource
public java.lang.String toString()
toString
in class java.lang.Object
public long getDeviceSize()
public java.lang.String getPath()
public int getStripeSize()
public int getNumDevs()
public long getTotalLen()
public static long malloc(long size)
size
- number of bytes to allocatepublic static int free_mem(long ptr)
ptr
- pointer to the starting address to free