Package com.bfo.box

Class DataBox

java.lang.Object
com.bfo.box.Box
com.bfo.box.DataBox
Direct Known Subclasses:
CborBox, JsonBox, XmlBox

public class DataBox extends Box
A general Box that stores its content as a byte array. Subclasses of DataBox can always be serialized with Box.getEncoded(). There is no "setData()" method - a subclass of the approriate type should be created.
Since:
5
  • Constructor Details

    • DataBox

      public DataBox()
      Create a new uninitialized box, for loading. Don't call this constructor
    • DataBox

      public DataBox(String label)
      Create a new DataBox
      Parameters:
      label - the label, which must not be null
    • DataBox

      public DataBox(String label, byte[] data)
      Create a new DataBox initialized to the specified data
      Parameters:
      label - the label, which must not be null
      data - the data, which is not cloned
  • Method Details

    • data

      public byte[] data()
      Return a copy of the byte data from this box. Subclasses should provided more semantically-appropriate methods to retrieve data.
      Returns:
      data the data