com.scarabsoft.jrest.converter.body.StringBodyConverter Maven / Gradle / Ivy
package com.scarabsoft.jrest.converter.body;
import java.io.UnsupportedEncodingException;
public final class StringBodyConverter implements BodyConverter {
@Override
public byte[] toBody(Object obj) throws UnsupportedEncodingException {
if (obj == null) {
return new byte[0];
}
return obj.toString().getBytes("UTF-8");
}
@Override
public String getMimetype() {
return "text/plain";
}
};
© 2015 - 2025 Weber Informatics LLC | Privacy Policy