code: private void setValue(final AttributeValue value, boolean fromMemorizedValue) throws DevFailed {
          if (!config.getWritable().equals(AttrWriteType.READ)) {
              // final Profiler profilerPeriod = new Profiler("write attribute " + name);
              // profilerPeriod.start("check");
              checkSetErrors(value);
              // profilerPeriod.start("clone");
              // copy value for safety and transform it to 2D array if necessary
              try {
                  writeValue = (AttributeValue) value.clone();
              } catch (final CloneNotSupportedException e) {
                  throw DevFailedUtils.newDevFailed(e);
              }
              // profilerPeriod.start("after clone");
              checkMinMaxValue();
              writtenTimestamp = writeValue.getTime();
              int dimY = writeValue.getYDim();
              if (config.getFormat().equals(AttrDataFormat.IMAGE) && dimY == 0) {
                  // force at least 1 to obtain a real 2D array with [][]
                  dimY = 1;
              }
              // profilerPeriod.start("convert image");
              value.setValue(ArrayUtils.fromArrayTo2DArray(writeValue.getValue(), writeValue.getXDim(), dimY),
                      writtenTimestamp);
              behavior.setValue(value);
              if (isMemorized() && getFormat().equals(AttrDataFormat.SCALAR) && !fromMemorizedValue) {
                  // TODO: refactoring to manage performance issues for spectrum and
                  // images
                  attributePropertiesManager.setAttributePropertyInDB(getName(), Constants.MEMORIZED_VALUE,
                          getValueAsString()[0]);
                  // if (getFormat().equals(AttrDataFormat.IMAGE)) {
                  // deviceImpl.setAttributePropertyInDB(att.getName(),
                  // Constants.MEMORIZED_VALUE_DIM,
                  // Integer.toString(value4.w_dim.dim_x),
                  // Integer.toString(value4.w_dim.dim_y));
                  // }
              }
              // profilerPeriod.stop().print();
          } else {
              throw DevFailedUtils.newDevFailed(ExceptionMessages.ATTR_NOT_WRITABLE, name + " is not writable");
          }
  
  
      }
docs: Write value
  
  @param value
  @param fromMemorizedValue true is value comes from tangodb
  @throws DevFailed