mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 11:49:04 +01:00
Added Consumer support to Writer, to avoid redundant copying.
This commit is contained in:
@@ -130,7 +130,12 @@ public class FileReadWriteTest extends TestCase {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWriteFile() throws Exception {
|
||||
public void testWriteAndRead() throws Exception {
|
||||
write();
|
||||
read();
|
||||
}
|
||||
|
||||
private void write() throws Exception {
|
||||
OutputStream out = new FileOutputStream(file);
|
||||
// Use Alice's secret for writing
|
||||
ConnectionWriter w = connectionWriterFactory.createConnectionWriter(out,
|
||||
@@ -177,10 +182,7 @@ public class FileReadWriteTest extends TestCase {
|
||||
assertTrue(file.length() > message.getSize());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWriteAndReadFile() throws Exception {
|
||||
|
||||
testWriteFile();
|
||||
private void read() throws Exception {
|
||||
|
||||
InputStream in = new FileInputStream(file);
|
||||
byte[] iv = new byte[16];
|
||||
|
||||
@@ -416,10 +416,6 @@ public class ReaderImplTest extends TestCase {
|
||||
out.write(b);
|
||||
}
|
||||
|
||||
public void write(byte[] b) throws IOException {
|
||||
out.write(b);
|
||||
}
|
||||
|
||||
public void write(byte[] b, int off, int len) throws IOException {
|
||||
out.write(b, off, len);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user