@Override
  public void set(File file, String view, String attribute, Object value, boolean create) {
    checkNotNull(value);
    checkNotCreate(view, attribute, create);

    byte[] bytes;
    if (value instanceof byte[]) {
      bytes = ((byte[]) value).clone();
    } else if (value instanceof ByteBuffer) {
      // value instanceof ByteBuffer
      ByteBuffer buffer = (ByteBuffer) value;
      bytes = new byte[buffer.remaining()];
      buffer.get(bytes);
    } else {
      throw invalidType(view, attribute, value, byte[].class, ByteBuffer.class);
    }

    file.setAttribute("user", attribute, bytes);
  }
Attribute provider that provides the {@link UserDefinedFileAttributeView} ("user"). Unlike most
other attribute providers, this one has no pre-defined set of attributes. Rather, it allows
arbitrary user defined attributes to be set (as {@code ByteBuffer} or {@code byte[]}) and read
(as {@code byte[]}).

@author Colin Decker
jimfs/src/main/java/com/google/common/jimfs/UserDefinedAttributeProvider.java