diff --git a/engine/src/networking/com/jme3/network/kernel/tcp/SelectorKernel.java b/engine/src/networking/com/jme3/network/kernel/tcp/SelectorKernel.java index 5fe3c006a..00060215f 100644 --- a/engine/src/networking/com/jme3/network/kernel/tcp/SelectorKernel.java +++ b/engine/src/networking/com/jme3/network/kernel/tcp/SelectorKernel.java @@ -118,13 +118,12 @@ public class SelectorKernel extends AbstractKernel if( !reliable ) throw new UnsupportedOperationException( "Unreliable send not supported by this kernel." ); - if( copy ) - { + if( copy ) { // Copy the data just once byte[] temp = new byte[data.remaining()]; System.arraycopy(data.array(), data.position(), temp, 0, data.remaining()); data = ByteBuffer.wrap(temp); - } + } // Hand it to all of the endpoints that match our routing for( NioEndpoint p : endpoints.values() ) { diff --git a/engine/src/networking/com/jme3/network/kernel/udp/UdpKernel.java b/engine/src/networking/com/jme3/network/kernel/udp/UdpKernel.java index 53a29fa78..d380b3746 100644 --- a/engine/src/networking/com/jme3/network/kernel/udp/UdpKernel.java +++ b/engine/src/networking/com/jme3/network/kernel/udp/UdpKernel.java @@ -126,13 +126,12 @@ public class UdpKernel extends AbstractKernel if( reliable ) throw new UnsupportedOperationException( "Reliable send not supported by this kernel." ); - if( copy ) - { + if( copy ) { // Copy the data just once byte[] temp = new byte[data.remaining()]; System.arraycopy(data.array(), data.position(), temp, 0, data.remaining()); data = ByteBuffer.wrap(temp); - } + } // Hand it to all of the endpoints that match our routing for( UdpEndpoint p : socketEndpoints.values() ) {