com.ibm.jtopenlite.ddm
Interface DDMWriteCallback


public interface DDMWriteCallback

Used by DDMConnection to obtain the input for a write operation from the user in a memory-conscious fashion.

Order of operations:
  1. DDMConnection.write(file, callback)
  2. --> callback.getNumberOfRecords()
  3. --> begin loop
  4. ------> callback.getRecordData()
  5. ------> callback.getRecordDataOffset()
  6. ------> callback.getNullFieldValues()
  7. ------> Record is written
  8. --> end loop


Method Summary
 boolean[] getNullFieldValues(DDMCallbackEvent event, int recordIndex)
          Returns the array of null field values, one for each field in the record to be written.
 int getNumberOfRecords(DDMCallbackEvent event)
          Returns the number of records to write, which is how many times the DDMConnection will call getRecordData() for a given write operation.
 byte[] getRecordData(DDMCallbackEvent event, int recordIndex)
          Returns the record data to write.
 int getRecordDataOffset(DDMCallbackEvent event, int recordIndex)
          Returns the offset into the byte array returned by the prior call to getRecordData() so that a single buffer can be used to write multiple records.
 

Method Detail

getNumberOfRecords

int getNumberOfRecords(DDMCallbackEvent event)
Returns the number of records to write, which is how many times the DDMConnection will call getRecordData() for a given write operation.


getRecordData

byte[] getRecordData(DDMCallbackEvent event,
                     int recordIndex)
Returns the record data to write.


getRecordDataOffset

int getRecordDataOffset(DDMCallbackEvent event,
                        int recordIndex)
Returns the offset into the byte array returned by the prior call to getRecordData() so that a single buffer can be used to write multiple records.


getNullFieldValues

boolean[] getNullFieldValues(DDMCallbackEvent event,
                             int recordIndex)
Returns the array of null field values, one for each field in the record to be written. Returning null indicates no fields should be written with a value of null.