construct binary

Vance Shipley <>
Thu Jul 7 18:56:28 CEST 2005


Mathias,

I'd have to say that your version is much better as it's shorter
and simpler.  Not to mention the fact that, as you pointed out,
my pad calculation was flawed.  The one difference though is that 
my version didn't create a new binary so would presumably be more
efficient.

	-Vance

On Thu, Jul 07, 2005 at 08:54:43AM +0200, Matthias Lang wrote:
}  
}  decode(<<N_channels:5, Alignment_bits:3, Tail/binary>>) ->
}          decode2(N_channels, <<Alignment_bits:3, Tail/binary, 0:5>>).
}  decode2(0, _) ->
}          [];
}  decode2(N, <<C:11, A:5, T/binary>>) ->
}          [C|decode2(N-1, <<A:5, T/binary, 0:3>>)].



More information about the erlang-questions mailing list