mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
consist of independently encrypted and authenticated packets (Ack, Batch, Subscriptions and Transports so far).
20 lines
490 B
Java
20 lines
490 B
Java
package net.sf.briar.api.protocol;
|
|
|
|
import java.io.IOException;
|
|
|
|
/** An interface for creating a batch of messages. */
|
|
public interface BatchWriter {
|
|
|
|
/** Returns the capacity of the batch in bytes. */
|
|
int getCapacity();
|
|
|
|
/**
|
|
* Attempts to add the given raw message to the batch and returns true if
|
|
* it was added.
|
|
*/
|
|
boolean addMessage(byte[] raw) throws IOException;
|
|
|
|
/** Finishes writing the batch and returns its unique identifier. */
|
|
BatchId finish() throws IOException;
|
|
}
|