Commit 753a25bc authored by Torsten Grote's avatar Torsten Grote

[core] Attachments will use InputStream rather than ByteBuffer

parent 8f4c3c45
Pipeline #2765 passed with stage
in 11 minutes and 12 seconds
package org.briarproject.briar.api.messaging;
import java.nio.ByteBuffer;
import java.io.InputStream;
public class Attachment {
private final ByteBuffer data;
private final InputStream stream;
public Attachment(ByteBuffer data) {
this.data = data;
public Attachment(InputStream stream) {
this.stream = stream;
}
public ByteBuffer getData() {
return data;
public InputStream getStream() {
return stream;
}
}
......@@ -42,7 +42,6 @@ import javax.annotation.concurrent.Immutable;
import javax.inject.Inject;
import static java.util.Collections.emptyList;
import static org.briarproject.bramble.api.sync.SyncConstants.MAX_MESSAGE_BODY_LENGTH;
import static org.briarproject.briar.client.MessageTrackerConstants.MSG_KEY_READ;
@Immutable
......@@ -238,10 +237,7 @@ class MessagingManagerImpl extends ConversationClientImpl
@Override
public Attachment getAttachment(MessageId m) {
// TODO add real implementation
// TODO return actual random/fake image before real implementation is done
byte[] b = new byte[MAX_MESSAGE_BODY_LENGTH];
new Random().nextBytes(b);
return new Attachment(ByteBuffer.wrap(b));
throw new IllegalStateException("Not yet implemented");
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment