|
|||||||||
| 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 |
int |
readBytes(byte[] buf,
int start,
int count)
simply read the bytes from the associated catalog |
void |
startRecord()
add a new record to the catalog |
void |
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 |
hashCode,
toString |
| Constructor Detail |
public ResizeStream(Catalog cat,
int initialSize)
cat - the catalog associatedinitialSize - the initial size of the record| Method Detail |
public void startRecord(int pos)
public void startRecord()
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()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||