|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjcontrol.storage.FlashStream
This class FlashStream represents a memory cached
data stream for reading and writing continuous data to the flash memory.
If the flash memory is full or some other error
occurs, an IOException is thrown.
Flash,
FlashTlv
| lib |
| Field Summary | |
protected byte[] |
cache
sector cache for faster reads |
protected byte |
m_bank
currently used flash bank (always starts at bank 0) |
protected int |
m_pos
position in current sector (for the stream) |
protected int |
m_sector
current sector |
protected int |
sectorcount
flash sectorsize and -count |
protected int |
sectorsize
flash sectorsize and -count |
| Constructor Summary | |
FlashStream()
Create a new flash stream. |
|
| Method Summary | |
void |
clearCache()
Frees the flash memory. |
void |
close()
|
int |
getSectorsize()
Returns the sectorsize. |
char |
read()
Read a single character from the flash stream. |
int |
read(byte[] buffer,
int startindex,
int length)
Read data from the flash stream. |
int |
write(byte[] buffer,
int startindex,
int length)
Write data to the flash stream. |
void |
write(char data)
Write a single character to the flash stream. |
| Methods inherited from class java.lang.Object |
clone, equals, notifyAll, wait |
| Field Detail |
protected byte[] cache
protected byte m_bank
protected int m_pos
protected int m_sector
protected int sectorcount
protected int sectorsize
| Constructor Detail |
public FlashStream()
throws java.io.IOException
java.io.IOException| Method Detail |
public void clearCache()
public void close()
close in interface jcontrol.io.BasicInputStreamBasicOutputStream.close()public int getSectorsize()
public char read()
throws java.io.IOException
read in interface jcontrol.io.BasicInputStreamjava.io.IOExceptionBasicInputStream.read()
public int read(byte[] buffer,
int startindex,
int length)
throws java.io.IOException
read in interface jcontrol.io.BasicInputStreamjava.io.IOExceptionBasicInputStream.read(byte[], int, int)
public int write(byte[] buffer,
int startindex,
int length)
throws java.io.IOException
Write data to the flash stream.
write in interface jcontrol.io.BasicOutputStreamjava.io.IOExceptionBasicOutputStream.write(byte[], int, int)
public void write(char data)
throws java.io.IOException
Write a single character to the flash stream.
write in interface jcontrol.io.BasicOutputStreamjava.io.IOExceptionBasicOutputStream.write(char)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||