Hook up MessagingManager to MessageInputStreamFactory.

This commit is contained in:
akwizgran
2018-12-06 15:03:58 +00:00
parent 3487a7cfee
commit 65e5dc266f
6 changed files with 51 additions and 14 deletions

View File

@@ -1,11 +1,21 @@
package org.briarproject.bramble.api.io;
import org.briarproject.bramble.api.db.DbException;
import org.briarproject.bramble.api.db.NoSuchBlockException;
import org.briarproject.bramble.api.sync.MessageId;
public interface BlockSource {
/**
* Returns the number of blocks in the given message.
*/
int getBlockCount(MessageId m) throws DbException;
/**
* Returns the given block of the given message.
*
* @throws NoSuchBlockException if 'blockNumber' is greater than or equal
* to the number of blocks in the message
*/
byte[] getBlock(MessageId m, int blockNumber) throws DbException;
}