Factory methods for segmented connection writers.

This commit is contained in:
akwizgran
2012-01-17 20:29:30 +00:00
parent dbeb7a207e
commit 6085b70b85
7 changed files with 38 additions and 30 deletions

View File

@@ -136,7 +136,7 @@ public class ProtocolIntegrationTest extends BriarTestCase {
private byte[] write() throws Exception {
ByteArrayOutputStream out = new ByteArrayOutputStream();
ConnectionWriter conn = connectionWriterFactory.createConnectionWriter(
out, Long.MAX_VALUE, secret.clone());
out, Long.MAX_VALUE, secret.clone(), true);
OutputStream out1 = conn.getOutputStream();
ProtocolWriter writer = protocolWriterFactory.createProtocolWriter(out1,
false);

View File

@@ -45,7 +45,7 @@ public class ConnectionWriterTest extends BriarTestCase {
ByteArrayOutputStream out =
new ByteArrayOutputStream(MIN_CONNECTION_LENGTH);
ConnectionWriter w = connectionWriterFactory.createConnectionWriter(out,
MIN_CONNECTION_LENGTH, secret);
MIN_CONNECTION_LENGTH, secret, true);
// Check that the connection writer thinks there's room for a packet
long capacity = w.getRemainingCapacity();
assertTrue(capacity >= MAX_PACKET_LENGTH);