예제 #1
0
    @Override
    public void visit(LwM2mObjectInstance instance) {
      LOG.trace("Encoding object instance {} into TLV", instance);

      // The instance is encoded as an array of resource TLVs.
      Tlv[] rTlvs = encodeResources(instance.getResources().values());

      try {
        out.write(TlvEncoder.encode(rTlvs).array());
      } catch (IOException e) {
        throw new RuntimeException(e);
      }
    }