public MARCRecord(char[] rawRecord) { char[] temp = new char[MARCChar.LEADER_LEN]; init(); try { Array.Copy(rawRecord, temp, MARCChar.LEADER_LEN); _ldr = new MARCLeader(temp); int dirLength = _ldr.getBaseAddressOfData() - MARCChar.LEADER_LEN; char[] temp1 = new char[dirLength]; Array.Copy(rawRecord, MARCChar.LEADER_LEN, temp1, 0, dirLength); _dir = new MARCRecordDirectory(temp1); MARCField field; ArrayList dirEntries = _dir.getEntries(); foreach (MARCDirectoryEntry entry in dirEntries) { temp1 = new char[entry.fieldLength]; Array.Copy(rawRecord, _ldr.getBaseAddressOfData() + entry.dataEnd, temp1, 0, entry.fieldLength); field = new MARCField(entry.tagStr, entry.fieldLength, temp1); addField(field); } //char[] dir = new build_dir(); build_Leader(); } catch (Exception ex) { _warning = "Error!"; } }
private void init() { _fields = new ArrayList(); _dir = new MARCRecordDirectory(); _ldr = null; _warning = new ArrayList(); }
public void build_Leader() { if (_ldr == null) { _ldr = new MARCLeader(getRecordLength(), getBaseAddress()); } }