INT-3577: Remove flush() from TCP Serializers
JIRA: https://jira.spring.io/browse/INT-3577 It is no longer necessary to `flush()` the `BufferedOutputStream`. Since INT-3575, the `TcpNetConnection` has flushed the stream. The `TcpNioConnection` now does so too. * Add `id` for the `<section>`s in the `whats-new.xml`
This commit is contained in:
committed by
Artem Bilan
parent
29e65e68af
commit
beeb49d55b
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -145,6 +145,7 @@ public class TcpNioConnection extends TcpConnectionSupport {
|
||||
this.lastSend = System.currentTimeMillis();
|
||||
try {
|
||||
((Serializer<Object>) this.getSerializer()).serialize(object, this.bufferedOutputStream);
|
||||
this.bufferedOutputStream.flush();
|
||||
}
|
||||
catch (Exception e) {
|
||||
this.publishConnectionExceptionEvent(e);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -89,7 +89,6 @@ public class ByteArrayCrLfSerializer extends AbstractByteArraySerializer {
|
||||
public void serialize(byte[] bytes, OutputStream outputStream) throws IOException {
|
||||
outputStream.write(bytes);
|
||||
outputStream.write(CRLF);
|
||||
outputStream.flush();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -133,7 +133,6 @@ public class ByteArrayLengthHeaderSerializer extends AbstractByteArraySerializer
|
||||
public void serialize(byte[] bytes, OutputStream outputStream) throws IOException {
|
||||
this.writeHeader(outputStream, bytes.length);
|
||||
outputStream.write(bytes);
|
||||
outputStream.flush();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -253,4 +252,5 @@ public class ByteArrayLengthHeaderSerializer extends AbstractByteArraySerializer
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -25,4 +25,5 @@ public class ByteArrayLfSerializer extends ByteArraySingleTerminatorSerializer {
|
||||
public ByteArrayLfSerializer() {
|
||||
super((byte) 0x0a);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -39,7 +39,6 @@ public class ByteArrayRawSerializer extends AbstractByteArraySerializer {
|
||||
public void serialize(byte[] bytes, OutputStream outputStream)
|
||||
throws IOException {
|
||||
outputStream.write(bytes);
|
||||
outputStream.flush();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -91,7 +91,6 @@ public class ByteArraySingleTerminatorSerializer extends AbstractByteArraySerial
|
||||
public void serialize(byte[] bytes, OutputStream outputStream) throws IOException {
|
||||
outputStream.write(bytes);
|
||||
outputStream.write(terminator);
|
||||
outputStream.flush();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -88,7 +88,6 @@ public class ByteArrayStxEtxSerializer extends AbstractByteArraySerializer {
|
||||
outputStream.write(STX);
|
||||
outputStream.write(bytes);
|
||||
outputStream.write(ETX);
|
||||
outputStream.flush();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -26,8 +26,8 @@ import java.util.Map;
|
||||
|
||||
import org.springframework.core.serializer.Deserializer;
|
||||
import org.springframework.core.serializer.Serializer;
|
||||
import org.springframework.integration.support.json.JsonObjectMapperProvider;
|
||||
import org.springframework.integration.support.json.JsonObjectMapper;
|
||||
import org.springframework.integration.support.json.JsonObjectMapperProvider;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
@@ -107,7 +107,6 @@ public class MapJsonSerializer implements Serializer<Map<?, ?>>, Deserializer<Ma
|
||||
throw new IOException(e);
|
||||
}
|
||||
this.packetSerializer.serialize(baos.toByteArray(), outputStream);
|
||||
outputStream.flush();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user