|
AddressSpace library v1.0 beta | |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--mmap.Page
Is the representation of a page for the virtual memory module.
Field Summary | |
protected byte[] |
data
Data contained in the page. |
protected static byte[] |
filler
An helper array used to obtain a zero-fill effect. |
protected static int |
interStep
The step used to optimize the checking if the page has content or not. |
static int |
pageSize
Size of a page. |
Constructor Summary | |
Page()
Create a new empty page. |
Method Summary | |
void |
dump()
Dump the page in a string readable format. |
byte[] |
getData()
Get the data contained in the page. |
boolean |
isAllZero()
Test if the page has contents beside zero. |
byte |
read(int offset)
Read a byte from the page. |
int |
read(int offset,
byte[] buffer)
Read an array of bytes from the page. |
int |
read(int offset,
byte[] buffer,
int len)
Read an array of bytes from the page. |
int |
read(int offset,
byte[] buffer,
int len,
int boffset)
Read an array of bytes from the page. |
int |
readInt(int offset)
Read an integer from the page. |
long |
readLong(int offset)
Read a long integer from the page. |
short |
readShort(int offset)
Read a short int from the page. |
java.lang.String |
toString()
|
java.lang.String |
toString(int id)
Convert the page in a string. |
int |
write(int offset,
byte v)
Write a byte in the page. |
int |
write(int offset,
byte[] buffer)
Write an array of bytes to the page. |
int |
write(int offset,
byte[] buffer,
int len)
Write an array of bytes to the page. |
int |
write(int offset,
byte[] buffer,
int len,
int boffset)
Write an array of bytes to the page. |
int |
writeInt(int offset,
int value)
Write an integer to the page. |
int |
writeLong(int offset,
long value)
Write a long integer to the page. |
int |
writeShort(int offset,
short value)
Write a short int to the page. |
void |
zeroFill()
Blank a page. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static final int pageSize
protected static byte[] filler
protected byte[] data
protected static final int interStep
Constructor Detail |
public Page()
Method Detail |
public void zeroFill()
public boolean isAllZero()
public byte read(int offset)
offset
- the location of the byte to read.public int read(int offset, byte[] buffer)
offset
- the location of the bytes to read.buffer
- the buffer to be filled.public int read(int offset, byte[] buffer, int len)
offset
- the location of the bytes to read.buffer
- the buffer to be filled.len
- the number of bytes to read.public int read(int offset, byte[] buffer, int len, int boffset)
offset
- the location of the bytes to read.buffer
- the buffer to be filled.len
- the number of bytes to read.boffset
- the offset inside the buffer.public int write(int offset, byte v)
offset
- the location of the byte to write.v
- the value to write.public int write(int offset, byte[] buffer)
offset
- the location of the bytes to write.buffer
- the buffer to be written.public int write(int offset, byte[] buffer, int len)
offset
- the location of the bytes to write.buffer
- the buffer to be written.len
- the number of bytes to write.public int write(int offset, byte[] buffer, int len, int boffset)
offset
- the location of the bytes to write.buffer
- the buffer to be written.len
- the number of bytes to write.boffset
- the offset inside the buffer.public byte[] getData()
public short readShort(int offset) throws NotAlignedPointer
offset
- the location of the page where the data is located.public int writeShort(int offset, short value) throws NotAlignedPointer
offset
- the location of the page where the data is located.public int readInt(int offset) throws NotAlignedPointer
offset
- the location of the page where the data is located.public int writeInt(int offset, int value) throws NotAlignedPointer
offset
- the location of the page where the data is located.public long readLong(int offset) throws NotAlignedPointer
offset
- the location of the page where the data is located.public int writeLong(int offset, long value) throws NotAlignedPointer
offset
- the location of the page where the data is located.public void dump()
public java.lang.String toString(int id)
public java.lang.String toString()
|
Help is irrilevant You will be assimilated! |
|||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |