summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTarun Gupta <tarun1995gupta@gmail.com>2015-07-17 02:22:32 (GMT)
committerNick Hudson <nick.hudson@isode.com>2015-07-28 13:14:20 (GMT)
commit673655830b0325d964e67fa835ea83f485e9beeb (patch)
tree27e4f8bd20dd9011207641a83212ced393fbada2 /src/com/isode/stroke/streamstack/ConnectionLayer.java
parent6f84f6a65b8b80e2f599dff76da0cd13fbead611 (diff)
downloadstroke-673655830b0325d964e67fa835ea83f485e9beeb.zip
stroke-673655830b0325d964e67fa835ea83f485e9beeb.tar.bz2
Complete StreamStack and add tests.
TLSLayer could not be updated because it requires TLS to be ported first. Updates other classes, only for having compatibility with SafeByteArray because of updates in Stream Stack. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Tests added for StreamStack and XMPPLayer, which passes. Change-Id: I8707fc1f16d622d2a90f6f39f671b7e7c46aa170
Diffstat (limited to 'src/com/isode/stroke/streamstack/ConnectionLayer.java')
-rw-r--r--src/com/isode/stroke/streamstack/ConnectionLayer.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/com/isode/stroke/streamstack/ConnectionLayer.java b/src/com/isode/stroke/streamstack/ConnectionLayer.java
index 0927a32..d003b52 100644
--- a/src/com/isode/stroke/streamstack/ConnectionLayer.java
+++ b/src/com/isode/stroke/streamstack/ConnectionLayer.java
@@ -4,7 +4,7 @@
*/
package com.isode.stroke.streamstack;
-import com.isode.stroke.base.ByteArray;
+import com.isode.stroke.base.SafeByteArray;
import com.isode.stroke.network.Connection;
import com.isode.stroke.signals.Slot1;
@@ -12,15 +12,15 @@ public class ConnectionLayer implements LowLayer {
public ConnectionLayer(Connection connection) {
this.connection = connection;
- connection.onDataRead.connect(new Slot1<ByteArray>() {
+ connection.onDataRead.connect(new Slot1<SafeByteArray>() {
- public void call(ByteArray p1) {
+ public void call(SafeByteArray p1) {
writeDataToParentLayer(p1);
}
});
}
- public void writeData(ByteArray data) {
+ public void writeData(SafeByteArray data) {
connection.write(data);
}
@@ -29,11 +29,11 @@ public class ConnectionLayer implements LowLayer {
/* Work around multiple inheritance workaround again */
StreamLayer fakeStreamLayer_ = new StreamLayer() {
- public void writeData(ByteArray data) {
+ public void writeData(SafeByteArray data) {
connection.write(data);
}
- public void handleDataRead(ByteArray data) {
+ public void handleDataRead(SafeByteArray data) {
throw new UnsupportedOperationException("Not supported yet.");
}
};
@@ -46,7 +46,7 @@ public class ConnectionLayer implements LowLayer {
fakeStreamLayer_.setParentLayer(parentLayer);
}
- public void writeDataToParentLayer(ByteArray data) {
+ public void writeDataToParentLayer(SafeByteArray data) {
fakeStreamLayer_.writeDataToParentLayer(data);
}
}