Add a simple protocol helper

This commit is contained in:
Carlos Martín Nieto
2013-05-27 02:18:25 +02:00
parent 523b20d70a
commit dacbbbc20e

8
src/geef_pkt.erl Normal file
View File

@@ -0,0 +1,8 @@
-module(geef_pkt).
-export([line/1]).
-spec line(iolist()) -> iolist().
line(Text) ->
Prefix = io_lib:format("~4.16.0b", [iolist_size(Text) + 1]),
[Prefix, Text, "\n"].