code: private static Object toStringType(Object value) {
      if (value instanceof String) {
        return value;
      } else if (value instanceof DataByteArray) {
        byte[] buf = ((DataByteArray)value).get();
        // mostly there is no need to copy.
        return ByteBuffer.wrap(Arrays.copyOf(buf, buf.length));
      }
      return null;
    }
docs: /* TType.STRING could be either a DataByteArray or a String