System information

Appendix D. JAVA Example Code
D-25
case type_ascii:
{
// we need to read off all of the possible bytes for the
// string field from the data message. This way, the
// pointer will be positioned at the right loc for the
// next field.
byte[] temp = msg.read_bytes(column.piece_size);
k += column.piece_size; // short circuit
//loop for strings
for(int m = 0; m < temp.length && temp[m] != 0; ++m)
System.out.print((char)temp[m]);
System.out.println("");
break;
}
case type_int2_lsf:
System.out.println("Not used by CR2xx");
msg.move_past(2);
break;
case type_int4_lsf:
System.out.println("Not used by CR2xx");
msg.move_past(4);
break;
case type_uint2_lsf:
System.out.println("Not used by CR2xx");
msg.move_past(2);
break;
case type_uint4_lsf:
System.out.println("Not used by CR2xx");
msg.move_past(4);
break;
case type_nsec_lsf:
System.out.println("Not used by CR2xx");
msg.move_past(8);
break;
case type_ieee4_lsf:
System.out.println("Not used by CR2xx");
msg.move_past(4);
break;
default:
System.out.println("Unsupported data type " +
column.field_type);
throw new Exception("Unsupported data type " +
column.field_type);
}
}
}
}
return rtn;
} // print_records