diff --git a/src/main/java/envoy/server/Startup.java b/src/main/java/envoy/server/Startup.java index 58a8366..dd295a4 100644 --- a/src/main/java/envoy/server/Startup.java +++ b/src/main/java/envoy/server/Startup.java @@ -6,6 +6,9 @@ import java.util.Set; import com.jenkov.nioserver.Server; +import envoy.server.net.ObjectMessageProcessor; +import envoy.server.net.ObjectMessageReader; + /** * Starts the server.
*
diff --git a/src/main/java/envoy/server/ObjectMessageProcessor.java b/src/main/java/envoy/server/net/ObjectMessageProcessor.java similarity index 97% rename from src/main/java/envoy/server/ObjectMessageProcessor.java rename to src/main/java/envoy/server/net/ObjectMessageProcessor.java index 53e53da..6f652d9 100644 --- a/src/main/java/envoy/server/ObjectMessageProcessor.java +++ b/src/main/java/envoy/server/net/ObjectMessageProcessor.java @@ -1,4 +1,4 @@ -package envoy.server; +package envoy.server.net; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -11,6 +11,8 @@ import com.jenkov.nioserver.IMessageProcessor; import com.jenkov.nioserver.Message; import com.jenkov.nioserver.WriteProxy; +import envoy.server.ObjectProcessor; + /** * Handles incoming objects.
*
diff --git a/src/main/java/envoy/server/ObjectMessageReader.java b/src/main/java/envoy/server/net/ObjectMessageReader.java similarity index 98% rename from src/main/java/envoy/server/ObjectMessageReader.java rename to src/main/java/envoy/server/net/ObjectMessageReader.java index f0fa73a..b477734 100644 --- a/src/main/java/envoy/server/ObjectMessageReader.java +++ b/src/main/java/envoy/server/net/ObjectMessageReader.java @@ -1,4 +1,4 @@ -package envoy.server; +package envoy.server.net; import java.io.IOException; import java.nio.ByteBuffer; @@ -26,11 +26,6 @@ public class ObjectMessageReader implements IMessageReader { private Message nextMessage; private MessageBuffer messageBuffer; - private int fromByteArray(byte[] bytes, int offset) { - return ((bytes[offset] & 0xFF) << 24) | ((bytes[offset + 1] & 0xFF) << 16) | ((bytes[offset + 2] & 0xFF) << 8) - | ((bytes[offset + 3] & 0xFF) << 0); - } - @Override public List getMessages() { return completeMessages; } @@ -65,4 +60,9 @@ public class ObjectMessageReader implements IMessageReader { buffer.clear(); } + + private int fromByteArray(byte[] bytes, int offset) { + return ((bytes[offset] & 0xFF) << 24) | ((bytes[offset + 1] & 0xFF) << 16) | ((bytes[offset + 2] & 0xFF) << 8) + | ((bytes[offset + 3] & 0xFF) << 0); + } } \ No newline at end of file