@Override
    public void process(OutputStream outputStream, Object element) throws IOException {
        try {
            outputStream.write(element.toString().getBytes("utf-8"));
        } catch (UnsupportedEncodingException e) {
            throw new IOException(e);
        }
    }
Serializer that writes the result of toString to output in UTF-8 encoding

@author alex
src/main/java/spark/serialization/DefaultSerializer.java