Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > e3d62627d1d1aab7ab1be2dd7f65a872 > files > 255

ecl-10.4.1-1.fc14.x86_64.rpm

<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>13.2.&#160;Input/Output model</title><link rel="stylesheet" href="ecl.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="The ECL manual"><link rel="up" href="ch13.html" title="Chapter&#160;13.&#160;Streams"><link rel="prev" href="ch13.html" title="Chapter&#160;13.&#160;Streams"><link rel="next" href="ch14.html" title="Chapter&#160;14.&#160;Printer"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">13.2.&#160;Input/Output model</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch13.html">Prev</a>&#160;</td><th width="60%" align="center">Chapter&#160;13.&#160;Streams</th><td width="20%" align="right">&#160;<a accesskey="n" href="ch14.html">Next</a></td></tr></table><hr></div><div class="section" title="13.2.&#160;Input/Output model"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sec.ansi.streams.io"></a>13.2.&#160;Input/Output model</h2></div></div></div><p><span class="application">ECL</span> distinguishes between two kinds of streams: character streams
  and byte streams. In the first kind one is only allowed to write
  characters, either individually, with <code class="function">write-char</code>, or
  in chunks, with <code class="function">write-sequence</code> or any of the Lisp
  printer functions. The implementation of character streams in <span class="application">ECL</span> has the
  following shortcomings:
  </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>No support for external formats. Reading and writing is
   performed using the 8-bit code of the character.</p></li><li class="listitem"><p>No support for Unicode characters. The code of large
   characters is simply truncated.</p></li></ul></div><p>The other kind are binary streams. Here input and output is performed
  in chunks of bits. Binary streams are created with the function
  <code class="function">open</code> passing as argument a subtype of
  <span class="type">integer</span>. We distinguish two cases
  </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>The word size is a multiple of 8 bits: element types
   <span class="type">(byte 8)</span>, <span class="type">(signed-byte 32)</span>,
   etc.</p></li><li class="listitem"><p>The word size is not a multiple of 8 bits: element types
   <span class="type">(unsigned-byte 3)</span>, <span class="type">(signed-byte 15)</span>,
   etc.</p></li></ul></div><p>
  In the first case the length of the file can be deduced from the number of
  octets which are used in the filesystem. In the second case, however, one
  needs some extra information which tells how many bits in the last byte are
  significant for the content. This information is stored as a single-byte
  header at the beginning of the file.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch13.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="ch13.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="ch14.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&#160;13.&#160;Streams&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;Chapter&#160;14.&#160;Printer</td></tr></table></div></body></html>