|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--waba.io.Stream
|
+--waba.io.ResizeStream
this class is used to create an resizable record. you can use it with DataStream. example:
Catalog cat = new Catalog(type+"."+creator+"."+type,Catalog.READ_WRITE); ResizeStream rs = new ResizeStream(cat,512); DataStream ds = new DataStream(rs); rs.startRecord(); ds.writeStringArray(aStringArray); rs.endRecord(); ds.close();
| Constructor Summary | |
ResizeStream(Catalog cat,
int initialSize)
constructs the resize stream. |
|
| Method Summary | |
boolean |
close()
closes the catalog |
void |
endRecord()
must be called after the record is finished so it can be resized |
boolean |
isOpen()
Returns true if this Stream is open and false otherwise |
int |
readBytes(byte[] buf,
int start,
int count)
simply read the bytes from the associated catalog |
boolean |
restartRecord(int pos)
Restart writing to the given record pos. |
boolean |
startRecord()
add a new record to the catalog. |
boolean |
startRecord(int pos)
inserts the record at the specified index in the catalog. |
int |
writeBytes(byte[] buf,
int start,
int count)
writes to the buffer, growing the record if necessary. |
| Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
toString,
wait,
wait |
| Constructor Detail |
public ResizeStream(Catalog cat,
int initialSize)
cat - the catalog associatedinitialSize - the initial size of the record. CANNOT BE 0!| Method Detail |
public boolean startRecord(int pos)
public boolean startRecord()
public boolean restartRecord(int pos)
public void endRecord()
public int readBytes(byte[] buf,
int start,
int count)
buf - the byte array to read data intostart - the start position in the arraycount - the number of bytes to read
public int writeBytes(byte[] buf,
int start,
int count)
buf - the byte array to write data fromstart - the start position in the byte arraycount - the number of bytes to writepublic boolean close()
public boolean isOpen()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||