<?xml version="1.0" ?>
<rss version="2.0">
<channel>
	<title>Lev Walkin → ASN.1 Exposed: streaming</title>
	<link>http://lionet.info/asn1c/blog/tag/streaming</link>
	<description>Entries of Lev Walkin → ASN.1 Exposed tagged with 'streaming'</description>


	<item>
		<title>Question: How to use streaming?</title>
		<description><![CDATA[
<p>
A <a href="https://sourceforge.net/projects/asn1c/forums/forum/357921/topic/3862507" class="external">Forum post</a> raises a question of the practical usage of streaming in the ASN.1 code generated by <a href="http://lionet.info/asn1c/" class="local">asn1c</a>:

<p>
<blockquote>
Hello,

I want to use the protocol to send a lot of data, but the device isn't able
to hold the whole amount of received data in RAM.
It has to work only with parts of the structure at a time.

<p>
For example,

<div><pre style="float: left; padding-right: 50px; min-width: 200px;">BigMessage ::= SEQUENCE {
    time-stamp UTCTime,
    messages SEQUENCE OF SmallMessage
}</pre><div style="clear: left;"></div></div>

<p>
If I get only the first half of the Big Message, I want to work with all received <code>messages</code> and then I have to to free my buffer due to limited resources. When I get the second part, I want to work on it and I want to know, if the message was valid...

<p>
On the encoder site, I also have to send "half" messages.

<p>
How can I do this? 
</blockquote>

The ASN.1 streaming is easily the most exciting thing the <a href="http://lionet.info/asn1c/" class="local">asn1c</a> has to offer. It's not something that's needed too often, but when it does, it's invaluable. Let's split the problem into two parts: how to decode in constant space and how to encode in constant space.
]]></description>
		<link>http://lionet.info/asn1c/blog/2010/09/22/question-how-to-use-streaming</link>
		<guid>http://lionet.info/asn1c/blog/2010/09/22/question-how-to-use-streaming</guid>
	</item>


</channel></rss>
