mirror of
https://github.com/alibaba/DataX.git
synced 2025-05-02 17:59:12 +08:00
fix bufferoverflow
This commit is contained in:
parent
293286ea14
commit
70975a0ed5
@ -96,8 +96,8 @@ public class DorisStreamLoadVisitor {
|
||||
private byte[] joinRows(List<String> rows, int totalBytes) {
|
||||
if (DorisWriterOptions.StreamLoadFormat.CSV.equals(writerOptions.getStreamLoadFormat())) {
|
||||
Map<String, Object> props = writerOptions.getLoadProps();
|
||||
ByteBuffer bos = ByteBuffer.allocate(totalBytes + rows.size());
|
||||
byte[] lineDelimiter = DorisDelimiterParser.parse(String.valueOf(props.get("row_delimiter")), "\n").getBytes(StandardCharsets.UTF_8);
|
||||
ByteBuffer bos = ByteBuffer.allocate(totalBytes + rows.size() * lineDelimiter.length);
|
||||
for (String row : rows) {
|
||||
bos.put(row.getBytes(StandardCharsets.UTF_8));
|
||||
bos.put(lineDelimiter);
|
||||
|
Loading…
Reference in New Issue
Block a user