Moved classes related to java-nio-server to envoy.server.net package.
This commit is contained in:
parent
a507ae85b2
commit
998fc3a91e
@ -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.<br>
|
||||
* <br>
|
||||
|
@ -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.<br>
|
||||
* <br>
|
@ -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<Message> 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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user