code: @Override
    public T decode(final byte[] buffer) {
      try (final ByteArrayInputStream bis = new ByteArrayInputStream(buffer);
           final DataInputStream dis = new DataInputStream(bis)) {
        final T writable = this.writableClass.newInstance();
        writable.readFields(dis);
        return writable;
      } catch (final IOException | InstantiationException | IllegalAccessException ex) {
        LOG.log(Level.SEVERE, "Cannot decode class " + this.writableClass, ex);
        throw new RemoteRuntimeException(ex);
      }
    }
docs: Decode Hadoop Writable object from a byte array.
  
  @param buffer serialized version of the Writable object (as a byte array).
  @return a Writable object.
  @throws RemoteRuntimeException if deserialization fails.