Class NAR

java.lang.Object
com.nt.udc.nar.NAR
All Implemented Interfaces:
DCFieldContainer, Serializable, Cloneable
Direct Known Subclasses:
FileEIRecord

public class NAR extends Object implements DCFieldContainer, Serializable, Cloneable
Used for passing data between Nodes.
See Also:
  • Field Details

  • Constructor Details

    • NAR

      public NAR()
    • NAR

      public NAR(byte[] bytes)
      Creates an NAR, where the NAR is completely in byte form. (This means the byte array contains the NAR length as well as the attributes).
      Parameters:
      bytes - bytes of the NAR
  • Method Details

    • clone

      public void clone(NAR newnar)
      Copies this into the given NAR. This is just another way to do the Cloneable clone() method.
      Parameters:
      newnar - Empty, or NAR being updated
    • clone

      public Object clone()
      Creates a copy of this NAR. For use with the Cloneable interface.
      Specified by:
      clone in interface DCFieldContainer
      Overrides:
      clone in class Object
      Returns:
      new NAR
    • toStream

      public void toStream(OutputStream oStream) throws IOException
      The method outputs an NAR to the output stream
      Parameters:
      oStream - output stream to write the NAR to
      Throws:
      IOException
    • toByteArray

      public final byte[] toByteArray()
      Returns a copy of the NAR's byte array.
      Specified by:
      toByteArray in interface DCFieldContainer
      Returns:
      NAR, in byte form
    • addAttribute

      @Deprecated public final void addAttribute(int id, byte value)
      Deprecated.
      Use setField(DCField)
    • addAttribute

      @Deprecated public final void addAttribute(int id, short value)
      Deprecated.
      Use setField(DCField)
    • addAttribute

      @Deprecated public final void addAttribute(int id, int value)
      Deprecated.
      Use setField(DCField)
    • addAttribute

      @Deprecated public final void addAttribute(int id, long value)
      Deprecated.
      Use setField(DCField)
    • addAttribute

      @Deprecated public final void addAttribute(int id, String value)
      Deprecated.
      Use setField(DCField)
    • addMillisAttribute

      @Deprecated public void addMillisAttribute(int id, long time)
      Deprecated.
      Use setField(DCField)
      Add a TIMEINMILLIS attribute to the NAR. If there is an attribute already associated with id, its value is replaced.
      Parameters:
      id - the id of the attribute
      time - the time in milliseconds value of the attribute
    • addSecondsAttribute

      @Deprecated public void addSecondsAttribute(int id, int time)
      Deprecated.
      Use setField(DCField)
      Add a TIMEINSECONDS attribute to the NAR. If there is an attribute already associated with id, its value is replaced.
      Parameters:
      id - the id of the attribute
      time - the time in seconds value of the attribute
    • addAttribute

      @Deprecated public final void addAttribute(int id, int type, String s)
      Deprecated.
      use Use setField(DCField)
    • addAttribute

      @Deprecated public final void addAttribute(int id, int type, byte[] value)
      Deprecated.
      Use setField(DCField)
    • addAttribute

      @Deprecated public final void addAttribute(DCField attr)
      Deprecated.
      Use Use setField(DCField)
    • shiftAttribute

      @Deprecated public void shiftAttribute(int oldId, int newId)
      Deprecated.
      Change an attribute's ID to a new ID.
      Parameters:
      oldId - Old attribute ID
      newId - New attribute ID
    • removeAttribute

      @Deprecated public DCField removeAttribute(int id)
      Deprecated.
      use removeField(FieldKey)
      This method removes an attribute with the given id.
      Parameters:
      id - id of the attribute
      Returns:
      DCField object, of the id
    • removeAttribute

      @Deprecated public DCField removeAttribute(String id)
      Deprecated.
      use removeField(FieldKey)
      This method removes an attribute with the given id.
      Parameters:
      id - id of the attribute
      Returns:
      DCField object, of the id
    • removeField

      public DCField removeField(FieldKey key)
    • remove

      @Deprecated public DCField remove(int id)
      Deprecated.
      use remove(FieldKey)
      Parameters:
      id -
      Returns:
    • remove

      @Deprecated public DCField remove(String id)
      Deprecated.
      use remove(FieldKey)
      Parameters:
      id -
      Returns:
    • getAttribute

      @Deprecated public DCField getAttribute(int id)
      Deprecated.
      use getField(FieldKey)
      The method to getAttr an DCField object with tag
      Parameters:
      id - id of the attribute
      Returns:
      DCField object, of the id
    • getAttribute

      @Deprecated public DCField getAttribute(String id)
      Deprecated.
      use getField(FieldKey)
      The method to getAttr an DCField object with tag
      Parameters:
      id - id of the attribute
      Returns:
      DCField object, of the id
    • getAllAttributes

      public DCField[] getAllAttributes()
      The method to getAttr all DCFields
      Returns:
      array of DCField objects
    • getAttributeValueBytes

      @Deprecated public byte[] getAttributeValueBytes(String id)
      Deprecated.
      Returns the attribute's value in bytes.
      Parameters:
      id - id of the attribute
      Returns:
      the bytes of the attribute's value
    • getAttributeValueBytes

      public byte[] getAttributeValueBytes(FieldKey key)
      Returns the attribute's value in bytes.
    • getAttributeValueBytes

      @Deprecated public byte[] getAttributeValueBytes(int id)
      Deprecated.
      Parameters:
      id -
      Returns:
    • containsAttr

      @Deprecated public boolean containsAttr(int id)
      Deprecated.
      use containsField(FieldKey)
      Tests if there is an attribute with the specified id in this NAR.
      Parameters:
      id - the id of the attribute
      Returns:
      true if an attribute with the given id exists in this NAR; false otherwise
    • containsField

      public boolean containsField(FieldKey id)
    • getAttrType

      public int getAttrType(String id)
      Gets the type of the attribute associated with the specified id.
      Parameters:
      id - the id of the attribute
      Returns:
      the type that is associated with the attribute specified by the id; -1 if the id does not identify an attribute in this NAR
    • getAttrType

      @Deprecated public int getAttrType(int id)
      Deprecated.
      Parameters:
      id -
      Returns:
    • getNumAttrs

      public int getNumAttrs()
      The method to getAttr the number of attributes
      Returns:
      number of attributes in the NAR
    • toString

      public String toString(com.nt.udc.datadictparser.DataDictionary dd)
    • toString

      public String toString()
      Description copied from interface: DCFieldContainer
      Converts the data contained in this object to a String
      Specified by:
      toString in interface DCFieldContainer
      Overrides:
      toString in class Object
      Returns:
      String representation of the data
    • toFormattedString

      public String toFormattedString(com.nt.udc.datadictparser.DataDictionary dd)
    • toFormattedString

      public String toFormattedString()
    • size

      public int size()
    • convertNarToString

      @Deprecated public String convertNarToString(com.nt.udc.datadictparser.DataDictionary dd)
      Deprecated.
    • convertNarToFormattedString

      public String convertNarToFormattedString()
    • convertNarToString

      public String convertNarToString()
    • update

      public void update(FieldKey key, DCField value)
    • getAttrAsByte

      public byte getAttrAsByte(int id) throws NoSuchFieldException, UnsupportedTypeException
      Gets the byte value of the attribute associated with the specified id. This method should only be used for BYTE attribute types.
      Parameters:
      id - the id of the attribute
      Returns:
      the byte value of the attribute associated with the specified id
      Throws:
      NoSuchFieldException - Thrown when the given id is not found.
      UnsupportedTypeException - Thrown when the type of the id cannot be converted to the return type.
    • getAttrAsBytes

      @Deprecated public byte[] getAttrAsBytes(int id)
      Deprecated.
      Gets the bytes value of the attribute associated with the specified id. This method should only be used for BYTES attribute types.
      Parameters:
      id - the id of the attribute
      Returns:
      the bytes value of the attribute associated with the specified id
    • getAttrAsShort

      @Deprecated public short getAttrAsShort(int id) throws NoSuchFieldException, UnsupportedTypeException
      Deprecated.
      use getField(FieldKey)
      Gets the short value of the attribute associated with the specified id. This method should only be used for SHORT, BYTE, and two byte STRING attribute types.
      Parameters:
      id - the id of the attribute
      Returns:
      the short value of the attribute associated with the specified id
      Throws:
      NoSuchFieldException - Thrown when the given id is not found.
      UnsupportedTypeException - Thrown when the type of the id cannot be converted to the return type.
    • getAttrAsInt

      @Deprecated public int getAttrAsInt(int id) throws NoSuchFieldException, UnsupportedTypeException
      Deprecated.
      use getField(FieldKey)
      Gets the integer value of the attribute associated with the specified id. This method should only be used for INTEGER, BYTE, SHORT, IP, TIMEINSECONDS and four byte STRING attribute types.
      Parameters:
      id - the id of the attribute
      Returns:
      the integer value of the attribute associated with the specified id
      Throws:
      NoSuchFieldException - Thrown when the given id is not found.
      UnsupportedTypeException - Thrown when the type of the id cannot be converted to the return type.
    • getAttrAsLong

      @Deprecated public long getAttrAsLong(int id) throws NoSuchFieldException, UnsupportedTypeException
      Deprecated.
      use getField(FieldKey)
      Gets the long value of the attribute associated with the specified id. This method should only be used for LONG, BYTE, SHORT, INTEGER, TIMEINSECONDS IP, FLOAT, TIMEINMILLIS, MAC, DOUBLE and eight byte STRING attribute types.
      Parameters:
      id - the id of the attribute
      Returns:
      the long value of the attribute associated with the specified id
      Throws:
      NoSuchFieldException - Thrown when the given id is not found.
      UnsupportedTypeException - Thrown when the type of the id cannot be converted to the return type.
    • getAttrAsFloat

      @Deprecated public float getAttrAsFloat(int id) throws NoSuchFieldException, UnsupportedTypeException
      Deprecated.
      use getField(FieldKey)
      Gets the float value of the attribute associated with the specified id. This method should only be used for FLOAT, BYTE, SHORT, INTEGER, TIMEINSECONDS and four byte STRING attribute types.
      Parameters:
      id - the id of the attribute
      Returns:
      the float value of the attribute associated with the specified id
      Throws:
      NoSuchFieldException - Thrown when the given id is not found.
      UnsupportedTypeException - Thrown when the type of the id cannot be converted to the return type.
    • getAttrAsDouble

      @Deprecated public double getAttrAsDouble(int id) throws NoSuchFieldException, UnsupportedTypeException
      Deprecated.
      use getField(FieldKey)
      Gets the double value of the attribute associated with the specified id. This method should only be used for DOUBLE, BYTE, SHORT, INTEGER, TIMEINSECONDS, FLOAT, TIMEINMILLIS, LONG and eight byte STRING attribute types.
      Parameters:
      id - the id of the attribute
      Returns:
      the double value of the attribute associated with the specified id
      Throws:
      NoSuchFieldException - Thrown when the given id is not found.
      UnsupportedTypeException - Thrown when the type of the id cannot be converted to the return type.
    • getAttrAsDate

      @Deprecated public Date getAttrAsDate(int id) throws NoSuchFieldException, UnsupportedTypeException
      Deprecated.
      use getField(FieldKey)
      Gets the Date value of the attribute associated with the specified id. This method should only be used for BYTE, SHORT, INTEGER, TIMEINSECONDS, FLOAT, LONG, TIMEINMILLIS, DOUBLE and eight byte STRING attribute types.
      Parameters:
      id - the id of the attribute
      Returns:
      the Date value of the attribute associatedi with the specified id
      Throws:
      NoSuchFieldException - Thrown when the given id is not found.
      UnsupportedTypeException - Thrown when the type of the id cannot be converted to the return type.
    • getAttrAsString

      Deprecated.
      use getField(FieldKey)
      Gets the string representation of the attribute associated with the specified id.
      Parameters:
      id - the id of the attribute
      Returns:
      a new String object representing the attribute associated with the specified id
      Throws:
      NoSuchFieldException - Thrown when the given id is not found.
      UnsupportedTypeException - Thrown when the type of the id cannot be converted to the return type.
      IOException
      ClassNotFoundException
    • getAttrAsMillis

      public long getAttrAsMillis(int id) throws NoSuchFieldException, UnsupportedTypeException
      Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by the attribute associated with the specified id. This method should only be used for BYTE, SHORT, INTEGER, TIMEINSECONDS, FLOAT, LONG, TIMEINMILLIS, DOUBLE and eight byte STRING attribute types.
      Parameters:
      id - the id of the attribute
      Returns:
      the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by the attribute associated with the specified id
      Throws:
      NoSuchFieldException - Thrown when the given id is not found.
      UnsupportedTypeException - Thrown when the type of the id cannot be converted to the return type.
    • getAttrAsTime

      public Date getAttrAsTime(int id) throws NoSuchFieldException, UnsupportedTypeException
      Gets the Time value of the attribute associated with the specified id. This method should only be used for BYTE, SHORT, INTEGER, TIMEINSECONDS, FLOAT, LONG, TIMEINMILLIS, DOUBLE and eight byte STRING attribute types.
      Parameters:
      id - the id of the attribute
      Returns:
      the Time value of the attribute associated with the specified id
      Throws:
      NoSuchFieldException - Thrown when the given id is not found.
      UnsupportedTypeException - Thrown when the type of the id cannot be converted to the return type.
    • getAttrAsObject

      @Deprecated public Object getAttrAsObject(int id) throws NoSuchFieldException, UnsupportedTypeException
      Deprecated.
      Gets the OBJECT value of the attribute associated with the specified id. This method should only be used for OBJECT attribute types.
      Parameters:
      id - the id of the attribute
      Returns:
      the object value of the attribute associated with the specified id; 0 if the associated attribute type does not support this value request, or if the id does not identify an attribute in this NAR
      Throws:
      NoSuchFieldException
      UnsupportedTypeException
    • getAttrAsList

      @Deprecated public ListField getAttrAsList(int id)
      Deprecated.
      Gets the LIST value of the attribute associated with the specified id. This method should only be used for LIST attribute types.
      Parameters:
      id - the id of the attribute
      Returns:
      the object value of the attribute associated with the specified id; 0 if the associated attribute type does not support this value request, or if the id does not identify an attribute in this NAR
    • getField

      @Deprecated public DCField getField(int id)
      Deprecated.
      Should use getAttribute(String)
      Gets a field according to it's integer ID
      Parameters:
      id - field id, in integer format
      Returns:
      field object
    • getField

      @Deprecated public DCField getField(String id)
      Deprecated.
      Should use getAttribute(String)
      Gets a field according to it's String ID
      Specified by:
      getField in interface DCFieldContainer
      Parameters:
      id - field id, in String format
      Returns:
      field object
    • getField

      public DCField getField(FieldKey id)
      Specified by:
      getField in interface DCFieldContainer
    • getFieldValue

      @Deprecated public byte[] getFieldValue(String id)
      Deprecated.
      Gets a field's value according to it's String ID
      Specified by:
      getFieldValue in interface DCFieldContainer
      Parameters:
      id - field id, in String format
      Returns:
      bytes, representing the field's value
    • getFieldValue

      @Deprecated public byte[] getFieldValue(int id)
      Deprecated.
      Parameters:
      id -
      Returns:
    • getFieldValue

      public byte[] getFieldValue(FieldKey key)
      Specified by:
      getFieldValue in interface DCFieldContainer
    • getType

      public int getType(String id)
      Returns the type of the given field. Types should be defined in DCField.
      Specified by:
      getType in interface DCFieldContainer
      Parameters:
      id - field id
      Returns:
      type of the field, as an integer
    • getType

      public int getType(int id)
    • setField

      public void setField(String fieldId, int type, byte[] value)
      Sets a field, with the given ID, type and value.
      Specified by:
      setField in interface DCFieldContainer
      Parameters:
      fieldId - field ID, in String form
      type - field type, as an integer
      value - field value, in byte[] form
    • setField

      public void setField(FieldKey attrId, int type, byte[] value)
      Specified by:
      setField in interface DCFieldContainer
    • setField

      public void setField(DCField field)
      Sets a field from its DCField form
      Specified by:
      setField in interface DCFieldContainer
      Parameters:
      field - field, in DCField form
    • setField

      @Deprecated public void setField(int id, int type, byte[] value)
      Deprecated.
      use setField(DCField)
      Sets a field, with the given ID, type and value.
      Specified by:
      setField in interface DCFieldContainer
      Parameters:
      id - field ID, in integer form
      type - field type, as an integer
      value - field value, in byte[] form
    • lookupDataType

      @Deprecated public int lookupDataType(String attrId) throws NonExistentAttributeException
      Deprecated.
      Should use getAttrType instead
      Retrieves the type of data stored with a specified id
      Parameters:
      attrId - Identifier of the desired field
      Returns:
      int attribute type, e.g. NAR.INT_TYPE, NAR.STRING_TYPE
      Throws:
      NonExistentAttributeException - if there is no attribute with the given attribute id.
    • lookupDataLength

      @Deprecated public int lookupDataLength(String attrId) throws NonExistentAttributeException
      Deprecated.
      Returns the length of data stored with a specified id expressed in number of bytes.
      Parameters:
      attrId - Identifier of the desired field
      Returns:
      int attribute type, e.g. NAR.INT_TYPE, NAR.STRING_TYPE
      Throws:
      NonExistentAttributeException - if there is no attribute with the given attribute id.
    • lookupDataBytes

      @Deprecated public void lookupDataBytes(String attrId, byte[] barr, int barrOffset) throws NonExistentAttributeException
      Deprecated.
      Retrieves the data stored with a specified id by storing the bytes into a given byte array at the specified offset. This method would throw a run-time exception if the specified array is not large enough to hold all the bytes of the specified data field starting at the given offset.
      Parameters:
      attrId - Identifier of the desired field
      barr - byte array to store the looked up data
      barrOffset - offset into the barr array where data will be stored
      Throws:
      NonExistentAttributeException - if there is no attribute with the given attribute id.
    • lookupByte

      Deprecated.
      Retrieves an byte field value with the specified id
      Parameters:
      attrId - Identifier of the desired field
      Returns:
      byte value stored against attrId
      Throws:
      NonExistentAttributeException - if there is no attribute with the given attribute id.
      InvalidAttributeTypeException - if the attribute stored with the given attribute id is not a byte.
    • lookupInt

      Deprecated.
      Retrieves an int field value with the specified id
      Parameters:
      attrId - Identifier of the desired field
      Returns:
      int value stored against attrId
      Throws:
      NonExistentAttributeException - if there is no attribute with the given attribute id.
      InvalidAttributeTypeException - if the attribute stored with the given attribute id is not a int.
    • lookupShort

      Deprecated.
      Retrieves an short field value with the specified id
      Parameters:
      attrId - Identifier of the desired field
      Returns:
      short value stored against attrId
      Throws:
      NonExistentAttributeException - if there is no attribute with the given attribute id.
      InvalidAttributeTypeException - if the attribute stored with the given attribute id is not a short.
    • lookupLong

      Deprecated.
      Retrieves an long field value with the specified id
      Parameters:
      attrId - Identifier of the desired field
      Returns:
      long value stored against attrId
      Throws:
      NonExistentAttributeException - if there is no attribute with the given attribute id.
      InvalidAttributeTypeException - if the attribute stored with the given attribute id is not a long.
    • lookupFloat

      Deprecated.
      Retrieves a float value with the specified id
      Parameters:
      attrId - Identifier of the desired field
      Returns:
      float value stored against attrId
      Throws:
      NonExistentAttributeException - if there is no attribute with the given attribute id.
      InvalidAttributeTypeException - if the attribute stored with the given attribute id is not a float.
    • lookupDouble

      Deprecated.
      Retrieves an double field value with the specified id
      Parameters:
      attrId - Identifier of the desired field
      Returns:
      double value stored against attrId
      Throws:
      NonExistentAttributeException - if there is no attribute with the given attribute id.
      InvalidAttributeTypeException - if the attribute stored with the given attribute id is not a double.
    • lookupString

      Deprecated.
      Retrieves a String object with the specified id Use lookupDataBytes() instead, if applicable.
      Parameters:
      attrId - Identifier of the desired field
      Returns:
      String object stored against attrId
      Throws:
      NonExistentAttributeException - if there is no attribute with the given attribute id.
      InvalidAttributeTypeException - if the attribute stored with the given attribute id is not a String.
    • lookupDataType

      @Deprecated public int lookupDataType(int attrId)
      Deprecated.
      Retrieves the type of data stored with a specified id
      Parameters:
      attrId - String identifier of the desired field
      Returns:
      int attribute type, e.g. NAR.INT_TYPE, NAR.STRING_TYPE
      Throws:
      NonExistentAttributeException - if there is no attribute with the given attribute id.
    • lookupDataLength

      @Deprecated public int lookupDataLength(int attrId)
      Deprecated.
      Returns the length of data stored with a specified id expressed in number of bytes.
      Parameters:
      attrId - String identifier of the desired field
      Returns:
      int attribute type, e.g. NAR.INT_TYPE, NAR.STRING_TYPE
      Throws:
      NonExistentAttributeException - if there is no attribute with the given attribute id.
    • lookupDataBytes

      @Deprecated public void lookupDataBytes(int attrId, byte[] barr, int barrOffset)
      Deprecated.
      Retrieves the data stored with a specified id by storing the bytes into a given byte array at the specified offset. This method would throw a run-time exception if the specified array is not large enough to hold all the bytes of the specified data field starting at the given offset.
      Parameters:
      attrId - String identifier of the desired field
      barr - byte array to store the looked up data
      barrOffset - offset into the barr array where data will be stored
      Throws:
      NonExistentAttributeException - if there is no attribute with the given attribute id.
    • lookupByte

      @Deprecated public byte lookupByte(int attrId)
      Deprecated.
      Retrieves an byte field value with the specified id
      Parameters:
      attrId - String identifier of the desired field
      Returns:
      byte value stored against attrId
      Throws:
      NonExistentAttributeException - if there is no attribute with the given attribute id.
      InvalidAttributeTypeException - if the attribute stored with the given attribute id is not a byte.
    • lookupInt

      @Deprecated public int lookupInt(int attrId)
      Deprecated.
      Retrieves an int field value with the specified id
      Parameters:
      attrId - String identifier of the desired field
      Returns:
      int value stored against attrId
      Throws:
      NonExistentAttributeException - if there is no attribute with the given attribute id.
      InvalidAttributeTypeException - if the attribute stored with the given attribute id is not a int.
    • lookupShort

      @Deprecated public short lookupShort(int attrId)
      Deprecated.
      Retrieves an short field value with the specified id
      Parameters:
      attrId - String identifier of the desired field
      Returns:
      short value stored against attrId
      Throws:
      NonExistentAttributeException - if there is no attribute with the given attribute id.
      InvalidAttributeTypeException - if the attribute stored with the given attribute id is not a short.
    • lookupLong

      @Deprecated public long lookupLong(int attrId)
      Deprecated.
      Retrieves an long field value with the specified id
      Parameters:
      attrId - String identifier of the desired field
      Returns:
      long value stored against attrId
      Throws:
      NonExistentAttributeException - if there is no attribute with the given attribute id.
      InvalidAttributeTypeException - if the attribute stored with the given attribute id is not a long.
    • lookupFloat

      @Deprecated public float lookupFloat(int attrId)
      Deprecated.
      Retrieves a float value with the specified id
      Parameters:
      attrId - String identifier of the desired field
      Returns:
      float value stored against attrId
      Throws:
      NonExistentAttributeException - if there is no attribute with the given attribute id.
      InvalidAttributeTypeException - if the attribute stored with the given attribute id is not a float.
    • lookupDouble

      @Deprecated public double lookupDouble(int attrId)
      Deprecated.
      Retrieves an double field value with the specified id
      Parameters:
      attrId - String identifier of the desired field
      Returns:
      double value stored against attrId
      Throws:
      NonExistentAttributeException - if there is no attribute with the given attribute id.
      InvalidAttributeTypeException - if the attribute stored with the given attribute id is not a double.
    • lookupString

      @Deprecated public String lookupString(int attrId)
      Deprecated.
      Retrieves a String object with the specified id Use lookupDataBytes() instead, if applicable.
      Parameters:
      attrId - String identifier of the desired field
      Returns:
      String object stored against attrId
      Throws:
      NonExistentAttributeException - if there is no attribute with the given attribute id.
      InvalidAttributeTypeException - if the attribute stored with the given attribute id is not a String.
    • writeByteArray

      public byte[] writeByteArray()
    • writeObject

      public int writeObject(OutputStream out) throws IOException
      Parameters:
      out -
      Throws:
      IOException
    • readByteArray

      public boolean readByteArray(byte[] barray)
    • readObject

      public boolean readObject(InputStream in) throws IOException
      Parameters:
      in -
      Throws:
      IOException
    • toRecArray

      public static NAR[] toRecArray(byte[] b)
    • fromBytes

      public static NAR fromBytes(byte[] b)
    • getLength

      public int getLength()
    • prepareByteArray

      public void prepareByteArray()
      Something for Multithreaded AP (and EP in the future) to use. This formats an internal byte array with the serialized version of the NAR, in preparation for output in a separate step. I expect this method to be called in the Field Processor threads, rather than the NARFileWriter (or similar) thread.
    • disposeByteArray

      public void disposeByteArray()
    • fieldExist

      public boolean fieldExist(FieldKey key)
      A proper implementation of fieldExist(). fieldExist() used to be implemented by returning (DCFieldContainer.getFieldValue(key) != null) which had a side effect of calling DCField.clone(). This method eliminates the clone().