mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-20 22:59:54 +01:00
Removed writer's count of bytes written and renamed a method.
This commit is contained in:
@@ -55,7 +55,7 @@ class AckWriterImpl implements AckWriter {
|
||||
}
|
||||
|
||||
private void start() throws IOException {
|
||||
w.writeUserDefinedTag(Types.ACK);
|
||||
w.writeUserDefinedId(Types.ACK);
|
||||
w.writeListStart();
|
||||
capacity -= headerLength;
|
||||
started = true;
|
||||
|
||||
@@ -61,7 +61,7 @@ class BatchWriterImpl implements BatchWriter {
|
||||
|
||||
private void start() throws IOException {
|
||||
messageDigest.reset();
|
||||
w.writeUserDefinedTag(Types.BATCH);
|
||||
w.writeUserDefinedId(Types.BATCH);
|
||||
w.writeListStart();
|
||||
capacity -= headerLength;
|
||||
started = true;
|
||||
|
||||
@@ -55,7 +55,7 @@ class OfferWriterImpl implements OfferWriter {
|
||||
}
|
||||
|
||||
private void start() throws IOException {
|
||||
w.writeUserDefinedTag(Types.OFFER);
|
||||
w.writeUserDefinedId(Types.OFFER);
|
||||
w.writeListStart();
|
||||
capacity -= headerLength;
|
||||
started = true;
|
||||
|
||||
@@ -21,7 +21,7 @@ class RequestWriterImpl implements RequestWriter {
|
||||
|
||||
public void writeRequest(BitSet b, int length)
|
||||
throws IOException {
|
||||
w.writeUserDefinedTag(Types.REQUEST);
|
||||
w.writeUserDefinedId(Types.REQUEST);
|
||||
// If the number of bits isn't a multiple of 8, round up to a byte
|
||||
int bytes = length % 8 == 0 ? length / 8 : length / 8 + 1;
|
||||
byte[] bitmap = new byte[bytes];
|
||||
|
||||
@@ -22,7 +22,7 @@ class SubscriptionWriterImpl implements SubscriptionWriter {
|
||||
|
||||
public void writeSubscriptions(Map<Group, Long> subs, long timestamp)
|
||||
throws IOException {
|
||||
w.writeUserDefinedTag(Types.SUBSCRIPTION_UPDATE);
|
||||
w.writeUserDefinedId(Types.SUBSCRIPTION_UPDATE);
|
||||
w.writeMap(subs);
|
||||
w.writeInt64(timestamp);
|
||||
out.flush();
|
||||
|
||||
@@ -22,10 +22,10 @@ class TransportWriterImpl implements TransportWriter {
|
||||
|
||||
public void writeTransports(Map<String, Map<String, String>> transports,
|
||||
long timestamp) throws IOException {
|
||||
w.writeUserDefinedTag(Types.TRANSPORT_UPDATE);
|
||||
w.writeUserDefinedId(Types.TRANSPORT_UPDATE);
|
||||
w.writeListStart();
|
||||
for(Entry<String, Map<String, String>> e : transports.entrySet()) {
|
||||
w.writeUserDefinedTag(Types.TRANSPORT_PROPERTIES);
|
||||
w.writeUserDefinedId(Types.TRANSPORT_PROPERTIES);
|
||||
w.writeString(e.getKey());
|
||||
w.writeMap(e.getValue());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user