mirror of
https://github.com/AsamK/signal-cli
synced 2025-09-02 04:20:38 +00:00
Fix handling of attachments in JSON RPC
It turns out that using a custom serializer on an input stream did not work well. For one the stream seems to be getting closed before the JSON gets written. But also the method for writing it was throwing an UnsupportedOperationException further down in Jackson. The above simplifies the matter by simply outputting the Base64 string first and then setting it on the model.
This commit is contained in:
parent
b6e9dfa97d
commit
54a55f4ea9
1 changed files with 0 additions and 18 deletions
|
@ -1,18 +0,0 @@
|
||||||
package org.asamk.signal.json;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonGenerator;
|
|
||||||
import com.fasterxml.jackson.databind.JsonSerializer;
|
|
||||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
|
|
||||||
public class JsonStreamSerializer extends JsonSerializer<InputStream> {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void serialize(
|
|
||||||
final InputStream value, final JsonGenerator jsonGenerator, final SerializerProvider serializers
|
|
||||||
) throws IOException {
|
|
||||||
jsonGenerator.writeBinary(value, -1);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue