import java.nio.charset.Charset;
import java.util.List;
import java.util.Map;
public class SingleStringRecordFormat extends ByteBufferRecordFormat<StructuredRecord> {
public static final String CHARSET = "charset";
<BUG>private Charset charset = Charsets.UTF_8;
@Override</BUG>
public StructuredRecord read(ByteBuffer input) {
String bodyAsStr = Bytes.toString(input, charset);
<BUG>return StructuredRecord.builder(schema).set("body", bodyAsStr).build();
</BUG>
}

import java.nio.charset.Charset;
import java.util.List;
import java.util.Map;
public class SingleStringRecordFormat extends ByteBufferRecordFormat<StructuredRecord> {
public static final String CHARSET = "charset";
private Charset charset = Charsets.UTF_8;
private String fieldName = "body";
@Override
public StructuredRecord read(ByteBuffer input) {
String bodyAsStr = Bytes.toString(input, charset);
return StructuredRecord.builder(schema).set(fieldName, bodyAsStr).build();
}
