You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Paolo Cristofanelli <cr...@gmail.com> on 2017/07/29 11:27:05 UTC

Reading byte[] from socket

Hi,

I would like to read a stream of byte[] from a socket. I know the
"writeToSocket" function that allows you to specify a serialization schema
to write your stream.

I would like to do the same but for reading, specifying a deserialization
schema that allows me to retrieve a stream of the class I have written
before.

Best Regards
Paolo

Re: Reading byte[] from socket

Posted by Fabian Hueske <fh...@gmail.com>.
Hi Paolo,

have a look at SocketTextStreamFunction [1] which is internally used when
StreamExecutionEnviornment.socketTextStream() is called.

Best, Fabian

[1]
https://github.com/apache/flink/blob/master/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/SocketTextStreamFunction.java

2017-07-29 13:27 GMT+02:00 Paolo Cristofanelli <
cristofanelli.paolo@gmail.com>:

> Hi,
>
> I would like to read a stream of byte[] from a socket. I know the
> "writeToSocket" function that allows you to specify a serialization schema
> to write your stream.
>
> I would like to do the same but for reading, specifying a deserialization
> schema that allows me to retrieve a stream of the class I have written
> before.
>
> Best Regards
> Paolo
>