﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- saved from url=(0014)about:internet -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta name="book" content="ActionScript&nbsp;3.0&nbsp;Language&nbsp;and&nbsp;Components&nbsp;Reference"><link rel="stylesheet" href="../../style.css" type="text/css" media="screen"><link rel="stylesheet" href="../../print.css" type="text/css" media="print"><link rel="stylesheet" href="../../override.css" type="text/css"><meta name="keywords" content="ByteArray,flash.utils.ByteArray,BIG_ENDIAN,DEFLATE,LITTLE_ENDIAN,ZLIB,bytesAvailable,bytesAvailable,currentCount,defaultObjectEncoding,delay,endian,endian,endian,length,objectEncoding,objectEncoding,objectEncoding,position,repeatCount,running,callProperty,clear,clearInterval,clearTimeout,compress,deflate,deleteProperty,describeType,escapeMultiByte,getDefinitionByName,getDescendants,getProperty,getQualifiedClassName,getQualifiedSuperclassName,getTimer,hasProperty,inflate,isAttribute,nextName,nextNameIndex,nextValue,readBoolean,readBoolean,readByte,readByte,readBytes,readBytes,readDouble,readDouble,readExternal,readFloat,readFloat,readInt,readInt,readMultiByte,readMultiByte,readObject,readObject,readShort,readShort,readUTFBytes,readUTFBytes,readUTF,readUTF,readUnsignedByte,readUnsignedByte,readUnsignedInt,readUnsignedInt,readUnsignedShort,readUnsignedShort,reset,setInterval,setProperty,setTimeout,start,stop,toString,uncompress,unescapeMultiByte,writeBoolean,writeBoolean,writeByte,writeByte,writeBytes,writeBytes,writeDouble,writeDouble,writeExternal,writeFloat,writeFloat,writeInt,writeInt,writeMultiByte,writeMultiByte,writeObject,writeObject,writeShort,writeShort,writeUTFBytes,writeUTFBytes,writeUTF,writeUTF,writeUnsignedInt,writeUnsignedInt"><title>flash.utils.ByteArray (ActionScript 3.0)</title><script src="../../AC_OETags.js" type="text/javascript"></script></head><body><script language="javascript" type="text/javascript" src="../../asdoc.js"></script><script language="javascript" type="text/javascript" src="../../help.js"></script><script language="javascript" type="text/javascript" src="../../cookies.js"></script><script language="javascript" type="text/javascript">  
            <!--  
			    
				asdocTitle = 'ByteArray - ActionScript 3.0 Language and Components Reference';

				var baseRef = '../../';

				window.onload = configPage;
			      
			    -->  
            </script>
<script language="javascript" type="text/javascript"><!--
function submitValue(){
var searchStr=document.getElementById('search-livedocs').value;
window.location="../../search.html"+"###"+searchStr;
}
--></script><script type="text/javascript">
		scrollToNameAnchor();
	</script><table class="titleTable" cellpadding="0" cellspacing="0" id="titleTable" style="display:none"><tr><td class="titleTableTitle" align="left">ActionScript 3.0 Language and Components Reference</td><td class="titleTableSearch" align="center"><form class="searchForm" method="get" action="../../search.html" onsubmit="submitValue();"><input class="hidden" name="loc" value="" type="hidden"><input class="hidden" name="termPrefix" value="" type="hidden"><input class="hidden" name="term" value="" type="hidden"><input class="hidden" name="area" value="" type="hidden"><input id="search-livedocs" name="search_text" value="" title="" type="text"> <input type="button" name="action" value="Search" onclick="submitValue()"></form></td><td class="titleTableTopNav" align="right"><a href="../../../../Flash/10.0_Welcome/index.html">Home</a>&nbsp;|&nbsp;<a href="../../package-summary.html" onclick="loadClassListFrame('../../all-classes.html')">All Packages</a>&nbsp;|&nbsp;<a href="../../class-summary.html" onclick="loadClassListFrame('../../all-classes.html')">All Classes</a>&nbsp;|&nbsp;<a href="../../language-elements.html">Language Elements</a>&nbsp;| <a href="../../all-index-Symbols.html" onclick="loadClassListFrame('../../index-list.html')">Index</a>&nbsp;|&nbsp;<a href="../../appendixes.html">Appendixes</a>&nbsp;|&nbsp;<a href="../../conventions.html">Conventions</a>&nbsp;|&nbsp;<a id="framesLink1" href="../../index.html?flash/utils/ByteArray.html&amp;flash/utils/class-list.html">Frames</a><a id="noFramesLink1" style="display:none" href="" onclick="parent.location=document.location"> No Frames </a></td><td class="titleTableLogo" align="right" rowspan="3"><img src="../../images/logo.jpg" class="logoImage" alt=" Adobe Logo " title=" Adobe Logo "></td></tr><tr class="titleTableRow2"><td class="titleTableSubTitle" id="subTitle" align="left">ByteArray</td><td class="titleTableSubNav" id="subNav" align="right" colspan="2"><a href="#propertySummary">Properties</a>&nbsp;| <a href="#methodSummary">Methods</a>&nbsp;| <a href="#eventSummary">Events</a>&nbsp;| <a href="#styleSummary">Styles</a>&nbsp;| <a href="#effectSummary">Effects</a>&nbsp;| <a href="#constantSummary">Constants</a>&nbsp;| <a href="#includeExamplesSummary">Examples</a></td></tr><tr class="titleTableRow3"><td colspan="3">&nbsp;</td></tr></table><script language="javascript" type="text/javascript" xml:space="preserve">
                
                    
                

				<!--

				
				    
				

					if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("ByteArray"); titleBar_setSubNav(false,true,false	,false,false,false,true,true,false	,false,false,false,false,false);}

				    
				        
				    
				-->
                
                    
                
			</script><div class="MainContent"><table class="classHeaderTable" cellpadding="0" cellspacing="0"><tr><td class="classHeaderTableLabel">Package</td><td><a href="package-detail.html" onclick="javascript:loadClassListFrame('class-list.html')">flash.utils</a></td></tr><tr><td class="classHeaderTableLabel">Class</td><td class="classSignature">public  class  ByteArray</td></tr><tr><td class="classHeaderTableLabel">Inheritance</td><td class="inheritanceList">ByteArray  <img src="../../images/inherit-arrow.gif" title="Inheritance" alt="Inheritance" class="inheritArrow"> <a href="../../Object.html">Object</a></td></tr><tr><td class="classHeaderTableLabel">Implements</td><td> <a href="../../flash/utils/IDataInput.html">IDataInput</a>,  <a href="../../flash/utils/IDataOutput.html">IDataOutput</a></td></tr></table><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p></p>
        The ByteArray class provides methods and properties to optimize reading, writing,
 and working with binary data.
        <p>
                  <i>Note:</i>
          The ByteArray class is for advanced developers who need to access 
 data on the byte level.
        </p>
        
               <p>
          In-memory data is a packed array (the most compact representation for the data type)
 of bytes, but an instance of the ByteArray
 class can be manipulated with the standard
          <code>[]</code>
          (array access) operators.
 It also can be read and written to as an in-memory file, using
 methods similar to those in the URLStream and Socket classes.
        </p>
        
               <p>In addition, zlib compression and decompression are supported, as
 well as Action Message Format (AMF) object serialization.</p>
        
               <p>
          Possible uses of the ByteArray class include the following:
          <ul>
                     <li>Creating a custom protocol to connect to a server.</li>
                     <li>Writing your own URLEncoder/URLDecoder.</li>
                     <li>Writing your own AMF/Remoting packet.</li>
                     <li>Optimizing the size of your data by using data types.</li>
                     <li>
              Working with binary data loaded from a file in 
   Adobe
              <sup>&reg;</sup>
              AIR
              <sup>&trade;</sup>
              .
            </li>
                  </ul>
          
               </p>
        
            <p></p><p><a href="#includeExamplesSummary">View the examples</a></p><p><span class="classHeaderTableLabel">See also</span></p><div class="seeAlso"><a href="../../operators.html#array_access" target="">[] (array access)</a><br/><a href="../../flash/net/Socket.html" target="">Socket class</a><br/><a href="../../flash/net/URLStream.html" target="">URLStream class</a></div><br/><hr></div><a name="propertySummary"></a><div class="summarySection"><div class="summaryTableTitle">Public Properties</div><div class="showHideLinks"><div id="hideInheritedProperty" class="hideInheritedProperty"><a class="showHideLink" href="#propertySummary" onclick="javascript:setInheritedVisible(false,'Property');"><img class="showHideLinkImage" src="../../images/expanded.gif"> Hide Inherited Public Properties</a></div><div id="showInheritedProperty" class="showInheritedProperty"><a class="showHideLink" href="#propertySummary" onclick="javascript:setInheritedVisible(true,'Property');"><img class="showHideLinkImage" src="../../images/collapsed.gif"> Show Inherited Public Properties</a></div></div><table cellspacing="0" cellpadding="3" class="summaryTable " id="summaryTableProperty"><tr><th>&nbsp;</th><th colspan="2">Property</th><th>Defined By</th></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a href="#bytesAvailable" class="signatureLink">bytesAvailable</a> : <a href="../../uint.html">uint</a><div class="summaryTableDescription">[read-only] The number of bytes of data available for reading
  from the current position in the byte array to the
  end of the array.</div></td><td class="summaryTableOwnerCol">ByteArray</td></tr><tr class="hideInheritedProperty"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="../../images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><a href="../../Object.html#constructor" class="signatureLink">constructor</a> : <a href="../../Object.html">Object</a><div class="summaryTableDescription">A reference to the class object or constructor function for a given object instance.</div></td><td class="summaryTableOwnerCol"><a href="../../Object.html">Object</a></td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a href="#defaultObjectEncoding" class="signatureLink">defaultObjectEncoding</a> : <a href="../../uint.html">uint</a><div class="summaryTableDescription">[static] Denotes the default object encoding for the ByteArray class to use for a new ByteArray instance.</div></td><td class="summaryTableOwnerCol">ByteArray</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a href="#endian" class="signatureLink">endian</a> : <a href="../../String.html">String</a><div class="summaryTableDescription">Changes or reads the byte order for the data; either Endian.BIG_ENDIAN or 
  Endian.LITTLE_ENDIAN.</div></td><td class="summaryTableOwnerCol">ByteArray</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a href="#length" class="signatureLink">length</a> : <a href="../../uint.html">uint</a><div class="summaryTableDescription">The length of the ByteArray object, in bytes.</div></td><td class="summaryTableOwnerCol">ByteArray</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a href="#objectEncoding" class="signatureLink">objectEncoding</a> : <a href="../../uint.html">uint</a><div class="summaryTableDescription">Used to determine whether the ActionScript 3.0, ActionScript 2.0, or ActionScript 1.0 format should be 
  used when writing to, or reading from, a ByteArray instance.</div></td><td class="summaryTableOwnerCol">ByteArray</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a href="#position" class="signatureLink">position</a> : <a href="../../uint.html">uint</a><div class="summaryTableDescription">Moves, or returns the current position, in bytes, of the file
  pointer into the ByteArray object.</div></td><td class="summaryTableOwnerCol">ByteArray</td></tr><tr class="hideInheritedProperty"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="../../images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><a href="../../Object.html#prototype" class="signatureLink">prototype</a> : <a href="../../Object.html">Object</a><div class="summaryTableDescription">[static] A reference to the prototype object of a class or function object.</div></td><td class="summaryTableOwnerCol"><a href="../../Object.html">Object</a></td></tr></table></div><a name="methodSummary"></a><div class="summarySection"><div class="summaryTableTitle">Public Methods </div><div class="showHideLinks"><div id="hideInheritedMethod" class="hideInheritedMethod"><a class="showHideLink" href="#methodSummary" onclick="javascript:setInheritedVisible(false,'Method');"><img class="showHideLinkImage" src="../../images/expanded.gif"> Hide Inherited Public Methods</a></div><div id="showInheritedMethod" class="showInheritedMethod"><a class="showHideLink" href="#methodSummary" onclick="javascript:setInheritedVisible(true,'Method');"><img class="showHideLinkImage" src="../../images/collapsed.gif"> Show Inherited Public Methods</a></div></div><table cellspacing="0" cellpadding="3" class="summaryTable " id="summaryTableMethod"><tr><th>&nbsp;</th><th colspan="2">Method</th><th>Defined By</th></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#ByteArray()" class="signatureLink">ByteArray</a>()</div><div class="summaryTableDescription">Creates a ByteArray instance representing a packed array of bytes, so that you can use the methods and properties in this class to optimize your data storage and stream.</div></td><td class="summaryTableOwnerCol">ByteArray</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#clear()" class="signatureLink">clear</a>():<a href="../../specialTypes.html#void">void</a></div><div class="summaryTableDescription">Clears the contents of the byte array and resets the length 
  and position properties to 0.</div></td><td class="summaryTableOwnerCol">ByteArray</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#compress()" class="signatureLink">compress</a>(algorithm:<a href="../../String.html">String</a>):<a href="../../specialTypes.html#void">void</a></div><div class="summaryTableDescription">Compresses the byte array.</div></td><td class="summaryTableOwnerCol">ByteArray</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#deflate()" class="signatureLink">deflate</a>():<a href="../../specialTypes.html#void">void</a></div><div class="summaryTableDescription">Compresses the byte array using the deflate compression algorithm.</div></td><td class="summaryTableOwnerCol">ByteArray</td></tr><tr class="hideInheritedMethod"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="../../images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="../../Object.html#hasOwnProperty()" class="signatureLink">hasOwnProperty</a>(name:<a href="../../String.html">String</a>):<a href="../../Boolean.html">Boolean</a></div><div class="summaryTableDescription">Indicates whether an object has a specified property defined.</div></td><td class="summaryTableOwnerCol"><a href="../../Object.html">Object</a></td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#inflate()" class="signatureLink">inflate</a>():<a href="../../specialTypes.html#void">void</a></div><div class="summaryTableDescription">Decompresses the byte array using the deflate compression algorithm.</div></td><td class="summaryTableOwnerCol">ByteArray</td></tr><tr class="hideInheritedMethod"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="../../images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="../../Object.html#isPrototypeOf()" class="signatureLink">isPrototypeOf</a>(theClass:<a href="../../Object.html">Object</a>):<a href="../../Boolean.html">Boolean</a></div><div class="summaryTableDescription">Indicates whether an instance of the Object class is in the prototype chain of the object specified 
  as the parameter.</div></td><td class="summaryTableOwnerCol"><a href="../../Object.html">Object</a></td></tr><tr class="hideInheritedMethod"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="../../images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="../../Object.html#propertyIsEnumerable()" class="signatureLink">propertyIsEnumerable</a>(name:<a href="../../String.html">String</a>):<a href="../../Boolean.html">Boolean</a></div><div class="summaryTableDescription">Indicates whether the specified property exists and is enumerable.</div></td><td class="summaryTableOwnerCol"><a href="../../Object.html">Object</a></td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#readBoolean()" class="signatureLink">readBoolean</a>():<a href="../../Boolean.html">Boolean</a></div><div class="summaryTableDescription">Reads a Boolean value from the byte stream.</div></td><td class="summaryTableOwnerCol">ByteArray</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#readByte()" class="signatureLink">readByte</a>():<a href="../../int.html">int</a></div><div class="summaryTableDescription">Reads a signed byte from the byte stream.</div></td><td class="summaryTableOwnerCol">ByteArray</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#readBytes()" class="signatureLink">readBytes</a>(bytes:<a href="../../flash/utils/ByteArray.html">ByteArray</a>, offset:<a href="../../uint.html">uint</a> = 0, length:<a href="../../uint.html">uint</a> = 0):<a href="../../specialTypes.html#void">void</a></div><div class="summaryTableDescription">Reads the number of data bytes, specified by the length parameter, from the byte stream.</div></td><td class="summaryTableOwnerCol">ByteArray</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#readDouble()" class="signatureLink">readDouble</a>():<a href="../../Number.html">Number</a></div><div class="summaryTableDescription">Reads an IEEE 754 double-precision (64-bit) floating-point number from the byte stream.</div></td><td class="summaryTableOwnerCol">ByteArray</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#readFloat()" class="signatureLink">readFloat</a>():<a href="../../Number.html">Number</a></div><div class="summaryTableDescription">Reads an IEEE 754 single-precision (32-bit) floating-point number from the byte stream.</div></td><td class="summaryTableOwnerCol">ByteArray</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#readInt()" class="signatureLink">readInt</a>():<a href="../../int.html">int</a></div><div class="summaryTableDescription">Reads a signed 32-bit integer from the byte stream.</div></td><td class="summaryTableOwnerCol">ByteArray</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#readMultiByte()" class="signatureLink">readMultiByte</a>(length:<a href="../../uint.html">uint</a>, charSet:<a href="../../String.html">String</a>):<a href="../../String.html">String</a></div><div class="summaryTableDescription">Reads a multibyte string of specified length from the byte stream using the
  specified character set.</div></td><td class="summaryTableOwnerCol">ByteArray</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#readObject()" class="signatureLink">readObject</a>():<a href="../../specialTypes.html#*">*</a></div><div class="summaryTableDescription">Reads an object from the byte array, encoded in AMF
  serialized format.</div></td><td class="summaryTableOwnerCol">ByteArray</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#readShort()" class="signatureLink">readShort</a>():<a href="../../int.html">int</a></div><div class="summaryTableDescription">Reads a signed 16-bit integer from the byte stream.</div></td><td class="summaryTableOwnerCol">ByteArray</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#readUnsignedByte()" class="signatureLink">readUnsignedByte</a>():<a href="../../uint.html">uint</a></div><div class="summaryTableDescription">Reads an unsigned byte from the byte stream.</div></td><td class="summaryTableOwnerCol">ByteArray</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#readUnsignedInt()" class="signatureLink">readUnsignedInt</a>():<a href="../../uint.html">uint</a></div><div class="summaryTableDescription">Reads an unsigned 32-bit integer from the byte stream.</div></td><td class="summaryTableOwnerCol">ByteArray</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#readUnsignedShort()" class="signatureLink">readUnsignedShort</a>():<a href="../../uint.html">uint</a></div><div class="summaryTableDescription">Reads an unsigned 16-bit integer from the byte stream.</div></td><td class="summaryTableOwnerCol">ByteArray</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#readUTF()" class="signatureLink">readUTF</a>():<a href="../../String.html">String</a></div><div class="summaryTableDescription">Reads a UTF-8 string from the byte stream.</div></td><td class="summaryTableOwnerCol">ByteArray</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#readUTFBytes()" class="signatureLink">readUTFBytes</a>(length:<a href="../../uint.html">uint</a>):<a href="../../String.html">String</a></div><div class="summaryTableDescription">Reads a sequence of UTF-8 bytes specified by the length
  parameter from the byte stream and returns a string.</div></td><td class="summaryTableOwnerCol">ByteArray</td></tr><tr class="hideInheritedMethod"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="../../images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="../../Object.html#setPropertyIsEnumerable()" class="signatureLink">setPropertyIsEnumerable</a>(name:<a href="../../String.html">String</a>, isEnum:<a href="../../Boolean.html">Boolean</a> = true):<a href="../../specialTypes.html#void">void</a></div><div class="summaryTableDescription">Sets the availability of a dynamic property for loop operations.</div></td><td class="summaryTableOwnerCol"><a href="../../Object.html">Object</a></td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#toString()" class="signatureLink">toString</a>():<a href="../../String.html">String</a></div><div class="summaryTableDescription">Converts the byte array to a string.</div></td><td class="summaryTableOwnerCol">ByteArray</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#uncompress()" class="signatureLink">uncompress</a>(algorithm:<a href="../../String.html">String</a>):<a href="../../specialTypes.html#void">void</a></div><div class="summaryTableDescription">Decompresses the byte array.</div></td><td class="summaryTableOwnerCol">ByteArray</td></tr><tr class="hideInheritedMethod"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="../../images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="../../Object.html#valueOf()" class="signatureLink">valueOf</a>():<a href="../../Object.html">Object</a></div><div class="summaryTableDescription">Returns the primitive value of the specified object.</div></td><td class="summaryTableOwnerCol"><a href="../../Object.html">Object</a></td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#writeBoolean()" class="signatureLink">writeBoolean</a>(value:<a href="../../Boolean.html">Boolean</a>):<a href="../../specialTypes.html#void">void</a></div><div class="summaryTableDescription">Writes a Boolean value.</div></td><td class="summaryTableOwnerCol">ByteArray</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#writeByte()" class="signatureLink">writeByte</a>(value:<a href="../../int.html">int</a>):<a href="../../specialTypes.html#void">void</a></div><div class="summaryTableDescription">Writes a byte to the byte stream.</div></td><td class="summaryTableOwnerCol">ByteArray</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#writeBytes()" class="signatureLink">writeBytes</a>(bytes:<a href="../../flash/utils/ByteArray.html">ByteArray</a>, offset:<a href="../../uint.html">uint</a> = 0, length:<a href="../../uint.html">uint</a> = 0):<a href="../../specialTypes.html#void">void</a></div><div class="summaryTableDescription">Writes a sequence of length bytes from the
  specified byte array, bytes,
  starting offset (zero-based index) bytes
  into the byte stream.</div></td><td class="summaryTableOwnerCol">ByteArray</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#writeDouble()" class="signatureLink">writeDouble</a>(value:<a href="../../Number.html">Number</a>):<a href="../../specialTypes.html#void">void</a></div><div class="summaryTableDescription">Writes an IEEE 754 double-precision (64-bit) floating-point number to the byte stream.</div></td><td class="summaryTableOwnerCol">ByteArray</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#writeFloat()" class="signatureLink">writeFloat</a>(value:<a href="../../Number.html">Number</a>):<a href="../../specialTypes.html#void">void</a></div><div class="summaryTableDescription">Writes an IEEE 754 single-precision (32-bit) floating-point number to the byte stream.</div></td><td class="summaryTableOwnerCol">ByteArray</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#writeInt()" class="signatureLink">writeInt</a>(value:<a href="../../int.html">int</a>):<a href="../../specialTypes.html#void">void</a></div><div class="summaryTableDescription">Writes a 32-bit signed integer to the byte stream.</div></td><td class="summaryTableOwnerCol">ByteArray</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#writeMultiByte()" class="signatureLink">writeMultiByte</a>(value:<a href="../../String.html">String</a>, charSet:<a href="../../String.html">String</a>):<a href="../../specialTypes.html#void">void</a></div><div class="summaryTableDescription">Writes a multibyte string to the byte stream using the specified character set.</div></td><td class="summaryTableOwnerCol">ByteArray</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#writeObject()" class="signatureLink">writeObject</a>(object:<a href="../../specialTypes.html#*">*</a>):<a href="../../specialTypes.html#void">void</a></div><div class="summaryTableDescription">Writes an object into the byte array in AMF
  serialized format.</div></td><td class="summaryTableOwnerCol">ByteArray</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#writeShort()" class="signatureLink">writeShort</a>(value:<a href="../../int.html">int</a>):<a href="../../specialTypes.html#void">void</a></div><div class="summaryTableDescription">Writes a 16-bit integer to the byte stream.</div></td><td class="summaryTableOwnerCol">ByteArray</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#writeUnsignedInt()" class="signatureLink">writeUnsignedInt</a>(value:<a href="../../uint.html">uint</a>):<a href="../../specialTypes.html#void">void</a></div><div class="summaryTableDescription">Writes a 32-bit unsigned integer to the byte stream.</div></td><td class="summaryTableOwnerCol">ByteArray</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#writeUTF()" class="signatureLink">writeUTF</a>(value:<a href="../../String.html">String</a>):<a href="../../specialTypes.html#void">void</a></div><div class="summaryTableDescription">Writes a UTF-8 string to the byte stream.</div></td><td class="summaryTableOwnerCol">ByteArray</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#writeUTFBytes()" class="signatureLink">writeUTFBytes</a>(value:<a href="../../String.html">String</a>):<a href="../../specialTypes.html#void">void</a></div><div class="summaryTableDescription">Writes a UTF-8 string to the byte stream.</div></td><td class="summaryTableOwnerCol">ByteArray</td></tr></table></div><script language="javascript" type="text/javascript"><!--
                      showHideInherited();
                      --></script><div class="MainContent"><div class="detailSectionHeader">Property Detail</div><a name="propertyDetail"></a><a name="bytesAvailable"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">bytesAvailable</td><td class="detailHeaderType">property</td></tr></table><div class="detailBody"><code>bytesAvailable:<a href="../../uint.html">uint</a></code>&nbsp;&nbsp;[read-only] <p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          The number of bytes of data available for reading
  from the current position in the byte array to the
  end of the array.
          <p>
            Use the
            <code>bytesAvailable</code>
            property in conjunction 
  with the read methods each time you access a ByteArray object 
  to ensure that you are reading valid data.
          </p>
          
        </p><br/><br/><span class="label"> Implementation </span><br/><code>&nbsp;&nbsp;&nbsp;&nbsp;public function get bytesAvailable():<a href="../../uint.html">uint</a></code><br/></div><a name="propertyDetail"></a><a name="defaultObjectEncoding"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">defaultObjectEncoding</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code>defaultObjectEncoding:<a href="../../uint.html">uint</a></code>&nbsp;&nbsp;[read-write] <p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Denotes the default object encoding for the ByteArray class to use for a new ByteArray instance.
  When you create a new ByteArray instance, the encoding on that instance starts
  with the value of
          <code>defaultObjectEncoding</code>
          .
  The
          <code>defaultObjectEncoding</code>
          property is initialized to
          <code>ObjectEncoding.AMF3</code>
          .
          <p>
            When an object is written to or read from binary data, the
            <code>objectEncoding</code>
            value
  is used to determine whether the ActionScript 3.0, ActionScript2.0, or ActionScript 1.0 format should be used. The value is a
  constant from the ObjectEncoding class.
          </p>
          
        </p><br/><br/><span class="label"> Implementation </span><br/><code>&nbsp;&nbsp;&nbsp;&nbsp;public static function get defaultObjectEncoding():<a href="../../uint.html">uint</a></code><br/><code>&nbsp;&nbsp;&nbsp;&nbsp;public function set defaultObjectEncoding(value:<a href="../../uint.html">uint</a>):<a href="../../specialTypes.html#void">void</a></code><br/><p><span class="label">See also</span></p><div class="seeAlso"><a href="../../flash/net/ObjectEncoding.html" target="">ObjectEncoding class</a><br/><a href="ByteArray.html#objectEncoding" target="">flash.utils.ByteArray.objectEncoding</a></div></div><a name="propertyDetail"></a><a name="endian"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">endian</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code>endian:<a href="../../String.html">String</a></code>&nbsp;&nbsp;[read-write] <p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Changes or reads the byte order for the data; either
          <code>Endian.BIG_ENDIAN</code>
          or
          <code>Endian.LITTLE_ENDIAN</code>
          .
        </p><br/><br/><span class="label"> Implementation </span><br/><code>&nbsp;&nbsp;&nbsp;&nbsp;public function get endian():<a href="../../String.html">String</a></code><br/><code>&nbsp;&nbsp;&nbsp;&nbsp;public function set endian(value:<a href="../../String.html">String</a>):<a href="../../specialTypes.html#void">void</a></code><br/><p><span class="label">See also</span></p><div class="seeAlso"><a href="Endian.html" target="">Endian class</a></div></div><a name="propertyDetail"></a><a name="length"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">length</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code>length:<a href="../../uint.html">uint</a></code>&nbsp;&nbsp;[read-write] <p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          The length of the ByteArray object, in bytes.
          <p>If the length is set to a value that is larger than the current length, 
  the the right side  of the byte array is filled with zeros.</p>
          
          <p>If the length is set to a value that is smaller than the
  current length, the byte array is truncated.</p>
          
        </p><br/><br/><span class="label"> Implementation </span><br/><code>&nbsp;&nbsp;&nbsp;&nbsp;public function get length():<a href="../../uint.html">uint</a></code><br/><code>&nbsp;&nbsp;&nbsp;&nbsp;public function set length(value:<a href="../../uint.html">uint</a>):<a href="../../specialTypes.html#void">void</a></code><br/></div><a name="propertyDetail"></a><a name="objectEncoding"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">objectEncoding</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code>objectEncoding:<a href="../../uint.html">uint</a></code>&nbsp;&nbsp;[read-write] <p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>Used to determine whether the ActionScript 3.0, ActionScript 2.0, or ActionScript 1.0 format should be 
  used when writing to, or reading from, a ByteArray instance. The value is a
  constant from the ObjectEncoding class.</p><br/><br/><span class="label"> Implementation </span><br/><code>&nbsp;&nbsp;&nbsp;&nbsp;public function get objectEncoding():<a href="../../uint.html">uint</a></code><br/><code>&nbsp;&nbsp;&nbsp;&nbsp;public function set objectEncoding(value:<a href="../../uint.html">uint</a>):<a href="../../specialTypes.html#void">void</a></code><br/><p><span class="label">See also</span></p><div class="seeAlso"><a href="../../flash/net/ObjectEncoding.html" target="">ObjectEncoding class</a><br/><a href="ByteArray.html#defaultObjectEncoding" target="">flash.utils.ByteArray.defaultObjectEncoding</a></div></div><a name="propertyDetail"></a><a name="position"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">position</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code>position:<a href="../../uint.html">uint</a></code>&nbsp;&nbsp;[read-write] <p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>Moves, or returns the current position, in bytes, of the file
  pointer into the ByteArray object. This is the
  point at which the next call to a read
  method starts reading or a write
  method starts writing.</p><br/><br/><span class="label"> Implementation </span><br/><code>&nbsp;&nbsp;&nbsp;&nbsp;public function get position():<a href="../../uint.html">uint</a></code><br/><code>&nbsp;&nbsp;&nbsp;&nbsp;public function set position(value:<a href="../../uint.html">uint</a>):<a href="../../specialTypes.html#void">void</a></code><br/></div><a name="constructorDetail"></a><div class="detailSectionHeader">Constructor Detail</div><a name="ByteArray()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">ByteArray</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">Constructor</td></tr></table><div class="detailBody"><code>public function ByteArray()</code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p>Creates a ByteArray instance representing a packed array of bytes, so that you can use the methods and properties in this class to optimize your data storage and stream.</p></div><a name="methodDetail"></a><div class="detailSectionHeader">Method Detail</div><a name="clear()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">clear</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td></tr></table><div class="detailBody"><code> public function clear():<a href="../../specialTypes.html#void">void</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>Flash Player 10, AIR 1.5</td></tr></table><p></p><p></p><p>
          Clears the contents of the byte array and resets the
          <code>length</code>
          and
          <code>position</code>
          properties to 0. Calling this method explicitly 
  frees up the memory used by the ByteArray instance.
        </p></div><a name="compress()"></a><a name="compress(String)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">compress</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function compress(algorithm:<a href="../../String.html">String</a>):<a href="../../specialTypes.html#void">void</a></code><p></p><p></p><p>
          Compresses the byte array. The entire byte array is compressed. For content   
  running in Adobe AIR, you can specify a compression algorithm by passing a
  value (defined in the CompressionAlgorithm class) as the
          <code>algorithm</code>
          parameter.
          <span>Flash Player supports only the default 
  algorithm, zlib.</span>
          
          <p>
            After the call, the
            <code>length</code>
            property of the ByteArray is set to the new length. 
  The
            <code>position</code>
            property is set to the end of the byte array.
          </p>
          
          <p>
            The zlib compressed data format is described at
            <a href="http://www.ietf.org/rfc/rfc1950.txt" target="external">http://www.ietf.org/rfc/rfc1950.txt</a>
            .
          </p>
          
          <p>
            The deflate compression algorithm is described at
            <a href="http://www.ietf.org/rfc/rfc1951.txt" target="external">http://www.ietf.org/rfc/rfc1951.txt</a>
            .
          </p>
          
          <p>The deflate compression algorithm is used in several compression
  formats, such as zlib, gzip, some zip implementations, and others. When data is
  compressed using one of those compression formats, in addition to storing 
  the compressed version of the original data, the compression format data 
  (for example, the .zip file) includes metadata information. Some examples of 
  the types of metadata included in various file formats are file name, 
  file modification date/time, original file size, optional comments, checksum 
  data, and more.</p>
          
          <p>
            For example, when a ByteArray is compressed using the zlib algorithm,
  the resulting ByteArray is structured in a specific format. Certain bytes contain 
  metadata about the compressed data, while other bytes contain the actual compressed 
  version of the original ByteArray data. As defined by the zlib compressed data 
  format specification, those bytes (that is, the portion containing 
  the compressed version of the original data) are compressed using the deflate 
  algorithm. Consequently those bytes are identical to the result of calling
            <code>
              compress(
              
              CompressionAlgorithm.DEFLATE)
            </code>
            on the original ByteArray. However, the result from
            <code>
              compress(
              
              CompressionAlgorithm.ZLIB)
            </code>
            includes 
  the extra metadata, while the
            <code>
              compress(
              
              CompressionAlgorithm.DEFLATE)
            </code>
            result includes only the compressed version of the original ByteArray data and nothing else.
          </p>
          
          <p>
            In order to use the deflate format to compress a ByteArray instance's 
  data in a specific format such as gzip or zip, you cannot simply call
            <code>
              compress(
              
              CompressionAlgorithm.DEFLATE)
            </code>
            . 
  You must create a ByteArray structured 
  according to the compression format's specification, including the appropriate 
  metadata as well as the compressed data obtained using the deflate format.
  Likewise, in order to decode data compressed in a format such 
  as gzip or zip, you can't simply call
            <code>
              uncompress(
              
              CompressionAlgorithm.DEFLATE)
            </code>
            on that data. First, you must separate the metadata from the compressed data, and you can
  then use the deflate format to decompress the compressed data.
          </p>
          
        </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">algorithm</span>:<a href="../../String.html">String</a></code> (default = <code>NaN</code>)<code></code> &mdash; 
              The compression algorithm to use when compressing. Valid values are defined as
  constants in the CompressionAlgorithm class. The default is to use zlib format.
              <span>This parameter is only recognized for content running in Adobe AIR. 
  Flash Player supports only the default algorithm, zlib, and throws an exception if you attempt to pass
  a value for this parameter.</span>
              Calling
              <code>
                compress(
                
                CompressionAlgorithm.DEFLATE)
              </code>
              has the same effect as calling the
              <code>deflate()</code>
              method.
            </td></tr></table></p><p><span class="label">See also</span></p><div class="seeAlso"><a href="ByteArray.html#uncompress()" target="">uncompress()</a><br/><a href="CompressionAlgorithm.html" target="">flash.utils.CompressionAlgorithm</a></div></div><a name="deflate()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">deflate</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function deflate():<a href="../../specialTypes.html#void">void</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>Flash Player 10, AIR 1.5</td></tr></table><p></p><p></p><p>
          Compresses the byte array using the deflate compression algorithm.
  The entire byte array is compressed.
          <p>
            After the call, the
            <code>length</code>
            property of the ByteArray is set to the new length. 
  The
            <code>position</code>
            property is set to the end of the byte array.
          </p>
          
          <p>
            The deflate compression algorithm is described at
            <a href="http://www.ietf.org/rfc/rfc1951.txt" target="external">http://www.ietf.org/rfc/rfc1951.txt</a>
            .
          </p>
          
          <p>
            In order to use the deflate format to compress a ByteArray instance's 
  data in a specific format such as gzip or zip, you cannot simply call
            <code>deflate()</code>
            . You must create a ByteArray structured 
  according to the compression format's specification, including the appropriate 
  metadata as well as the compressed data obtained using the deflate format.
  Likewise, in order to decode data compressed in a format such 
  as gzip or zip, you can't simply call
            <code>inflate()</code>
            on that data. First, you must separate the metadata from the compressed data, and you can
  then use the deflate format to decompress the compressed data.
          </p>
          
        </p><p><span class="label">See also</span></p><div class="seeAlso"><a href="ByteArray.html#inflate()" target="">inflate()</a></div></div><a name="inflate()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">inflate</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function inflate():<a href="../../specialTypes.html#void">void</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 10</td></tr></table><p></p><p></p><p>
          Decompresses the byte array using the deflate compression algorithm. 
  The byte array must have been compressed using the same algorithm.
          <p>
            After the call, the
            <code>length</code>
            property of the ByteArray is set to the new length. 
  The
            <code>position</code>
            property is set to 0.
          </p>
          
          <p>
            The deflate compression algorithm is described at
            <a href="http://www.ietf.org/rfc/rfc1951.txt" target="external">http://www.ietf.org/rfc/rfc1951.txt</a>
            .
          </p>
          
          <p>
            In order to decode data compressed in a format that uses the deflate compression algorithm, 
  such as data in gzip or zip format, it will not work to simply call
            <code>inflate()</code>
            on 
  a ByteArray containing the compression formation data. First, you must separate the metadata that is 
  included as part of the compressed data format from the actual compressed data. For more 
  information, see the
            <code>compress()</code>
            method description.
          </p>
          
        </p><br/><span class="label">Throws</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../flash/errors/IOError.html">IOError</a> </code> &mdash; The data is not valid compressed data; it was not compressed with the 
  same compression algorithm used to compress.</td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="ByteArray.html#deflate()" target="">deflate()</a></div></div><a name="readBoolean()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">readBoolean</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function readBoolean():<a href="../../Boolean.html">Boolean</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Reads a Boolean value from the byte stream. A single byte is read,
  and
          <code>true</code>
          is returned if the byte is nonzero,
          <code>false</code>
          otherwise.
        </p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../Boolean.html">Boolean</a></code> &mdash; 
              Returns
              <code>true</code>
              if the byte is nonzero,
              <code>false</code>
              otherwise.
            </td></tr></table><br/><span class="label">Throws</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../flash/errors/EOFError.html">EOFError</a> </code> &mdash; There is not sufficient data available
  to read.</td></tr></table></div><a name="readByte()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">readByte</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function readByte():<a href="../../int.html">int</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Reads a signed byte from the byte stream.
          <p>The returned value is in the range -128 to 127.</p>
          
        </p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../int.html">int</a></code> &mdash; An integer between -128 and 127.</td></tr></table><br/><span class="label">Throws</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../flash/errors/EOFError.html">EOFError</a> </code> &mdash; There is not sufficient data available
  to read.</td></tr></table></div><a name="readBytes()"></a><a name="readBytes(flash.utils.ByteArray,uint,uint)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">readBytes</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function readBytes(bytes:<a href="../../flash/utils/ByteArray.html">ByteArray</a>, offset:<a href="../../uint.html">uint</a> = 0, length:<a href="../../uint.html">uint</a> = 0):<a href="../../specialTypes.html#void">void</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Reads the number of data bytes, specified by the
          <code>length</code>
          parameter, from the byte stream.
  The bytes are read into the ByteArray object specified by the
          <code>bytes</code>
          parameter, 
  and the bytes are written into the destination ByteArray starting at the position specified by
          <code>offset</code>
          .
        </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">bytes</span>:<a href="../../flash/utils/ByteArray.html">ByteArray</a></code> &mdash; The ByteArray object to read data into.</td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20px"></td><td><code><span class="label">offset</span>:<a href="../../uint.html">uint</a></code> (default = <code>0</code>)<code></code> &mdash; 
              The offset (position) in
              <code>bytes</code>
              at which the read data should be written.
            </td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20px"></td><td><code><span class="label">length</span>:<a href="../../uint.html">uint</a></code> (default = <code>0</code>)<code></code> &mdash; The number of bytes to read.  The default value of 0 causes all available data to be read.</td></tr></table></p><br/><span class="label">Throws</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../flash/errors/EOFError.html">EOFError</a> </code> &mdash; There is not sufficient data available
  to read.</td></tr></table></div><a name="readDouble()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">readDouble</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function readDouble():<a href="../../Number.html">Number</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>Reads an IEEE 754 double-precision (64-bit) floating-point number from the byte stream.</p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../Number.html">Number</a></code> &mdash; A double-precision (64-bit) floating-point number.</td></tr></table><br/><span class="label">Throws</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../flash/errors/EOFError.html">EOFError</a> </code> &mdash; There is not sufficient data available
  to read.</td></tr></table></div><a name="readFloat()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">readFloat</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function readFloat():<a href="../../Number.html">Number</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>Reads an IEEE 754 single-precision (32-bit) floating-point number from the byte stream.</p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../Number.html">Number</a></code> &mdash; A single-precision (32-bit) floating-point number.</td></tr></table><br/><span class="label">Throws</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../flash/errors/EOFError.html">EOFError</a> </code> &mdash; There is not sufficient data available
  to read.</td></tr></table></div><a name="readInt()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">readInt</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function readInt():<a href="../../int.html">int</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Reads a signed 32-bit integer from the byte stream.
          <p>The returned value is in the range -2147483648 to 2147483647.</p>
          
        </p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../int.html">int</a></code> &mdash; A 32-bit signed integer between -2147483648 and 2147483647.</td></tr></table><br/><span class="label">Throws</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../flash/errors/EOFError.html">EOFError</a> </code> &mdash; There is not sufficient data available
  to read.</td></tr></table></div><a name="readMultiByte()"></a><a name="readMultiByte(uint,String)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">readMultiByte</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function readMultiByte(length:<a href="../../uint.html">uint</a>, charSet:<a href="../../String.html">String</a>):<a href="../../String.html">String</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>Reads a multibyte string of specified length from the byte stream using the
  specified character set.</p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">length</span>:<a href="../../uint.html">uint</a></code> &mdash; The number of bytes from the byte stream to read.</td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20px"></td><td><code><span class="label">charSet</span>:<a href="../../String.html">String</a></code> &mdash; 
              The string denoting the character set to use to interpret the bytes. 
  Possible character set strings include
              <code>"shift-jis"</code>
              ,
              <code>"cn-gb"</code>
              ,
              <code>"iso-8859-1"</code>
              , and others.
  For a complete list, see
              <a href="../../charset-codes.html" target="">Supported Character Sets</a>
              .
              <p>
                <b>Note:</b>
                If the value for the
                <code>charSet</code>
                parameter 
  is not recognized by the current system, the application uses the system's default 
  code page as the character set. For example, a value for the
                <code>charSet</code>
                parameter, 
  as in
                <code>myTest.readMultiByte(22, "iso-8859-01")</code>
                that uses
                <code>01</code>
                instead of
                <code>1</code>
                might work on your development machine, but not on another machine. 
  On the other machine, the application will use the system's default code page.
              </p>
              
            </td></tr></table></p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../String.html">String</a></code> &mdash; UTF-8 encoded string.</td></tr></table><br/><span class="label">Throws</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../flash/errors/EOFError.html">EOFError</a> </code> &mdash; There is not sufficient data available
  to read.</td></tr></table></div><a name="readObject()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">readObject</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function readObject():<a href="../../specialTypes.html#*">*</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>Reads an object from the byte array, encoded in AMF
  serialized format.</p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../specialTypes.html#*">*</a></code> &mdash; The deserialized object.</td></tr></table><br/><span class="label">Throws</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../flash/errors/EOFError.html">EOFError</a> </code> &mdash; There is not sufficient data available
  to read.</td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="../../flash/net/package.html#registerClassAlias()" target="">flash.net.registerClassAlias()</a></div></div><a name="readShort()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">readShort</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function readShort():<a href="../../int.html">int</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Reads a signed 16-bit integer from the byte stream.
          <p>The returned value is in the range -32768 to 32767.</p>
          
        </p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../int.html">int</a></code> &mdash; A 16-bit signed integer between -32768 and 32767.</td></tr></table><br/><span class="label">Throws</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../flash/errors/EOFError.html">EOFError</a> </code> &mdash; There is not sufficient data available
  to read.</td></tr></table></div><a name="readUnsignedByte()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">readUnsignedByte</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function readUnsignedByte():<a href="../../uint.html">uint</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Reads an unsigned byte from the byte stream.
          <p>The returned value is in the range 0 to 255.</p>
          
        </p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../uint.html">uint</a></code> &mdash; A 32-bit unsigned integer between 0 and 255.</td></tr></table><br/><span class="label">Throws</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../flash/errors/EOFError.html">EOFError</a> </code> &mdash; There is not sufficient data available
  to read.</td></tr></table></div><a name="readUnsignedInt()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">readUnsignedInt</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function readUnsignedInt():<a href="../../uint.html">uint</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Reads an unsigned 32-bit integer from the byte stream.
          <p>The returned value is in the range 0 to 4294967295.</p>
          
        </p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../uint.html">uint</a></code> &mdash; A 32-bit unsigned integer between 0 and 4294967295.</td></tr></table><br/><span class="label">Throws</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../flash/errors/EOFError.html">EOFError</a> </code> &mdash; There is not sufficient data available
  to read.</td></tr></table></div><a name="readUnsignedShort()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">readUnsignedShort</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function readUnsignedShort():<a href="../../uint.html">uint</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Reads an unsigned 16-bit integer from the byte stream.
          <p>The returned value is in the range 0 to 65535.</p>
          
        </p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../uint.html">uint</a></code> &mdash; A 16-bit unsigned integer between 0 and 65535.</td></tr></table><br/><span class="label">Throws</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../flash/errors/EOFError.html">EOFError</a> </code> &mdash; There is not sufficient data available
  to read.</td></tr></table></div><a name="readUTF()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">readUTF</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function readUTF():<a href="../../String.html">String</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>Reads a UTF-8 string from the byte stream.  The string
  is assumed to be prefixed with an unsigned short indicating
  the length in bytes.</p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../String.html">String</a></code> &mdash; UTF-8 encoded  string.</td></tr></table><br/><span class="label">Throws</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../flash/errors/EOFError.html">EOFError</a> </code> &mdash; There is not sufficient data available
  to read.</td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="IDataInput.html#readUTF()" target="">flash.utils.IDataInput.readUTF()</a></div></div><a name="readUTFBytes()"></a><a name="readUTFBytes(uint)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">readUTFBytes</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function readUTFBytes(length:<a href="../../uint.html">uint</a>):<a href="../../String.html">String</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Reads a sequence of UTF-8 bytes specified by the
          <code>length</code>
          parameter from the byte stream and returns a string.
        </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">length</span>:<a href="../../uint.html">uint</a></code> &mdash; An unsigned short indicating the length of the UTF-8 bytes.</td></tr></table></p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../String.html">String</a></code> &mdash; A string composed of the UTF-8 bytes of the specified length.</td></tr></table><br/><span class="label">Throws</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../flash/errors/EOFError.html">EOFError</a> </code> &mdash; There is not sufficient data available
  to read.</td></tr></table></div><a name="toString()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">toString</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function toString():<a href="../../String.html">String</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Converts the byte array to a string.
  If the data in the array begins with a Unicode byte order mark, the application will honor that mark
     when converting to a string. If
          <code>System.useCodePage</code>
          is set to
          <code>true</code>
          , the
  application will treat the data in the array as being in the current system code page when converting.
        </p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../String.html">String</a></code> &mdash; The string representation of the byte array.</td></tr></table></div><a name="uncompress()"></a><a name="uncompress(String)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">uncompress</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function uncompress(algorithm:<a href="../../String.html">String</a>):<a href="../../specialTypes.html#void">void</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Decompresses the byte array. For content running in Adobe AIR, you can specify 
  a compression algorithm by passing a value (defined in the CompressionAlgorithm class) 
  as the
          <code>algorithm</code>
          parameter. The byte array must have been compressed 
  using the same algorithm.
          <span>Flash Player supports only the 
  default algorithm, zlib.</span>
          
          <p>
            After the call, the
            <code>length</code>
            property of the ByteArray is set to the new length. 
  The
            <code>position</code>
            property is set to 0.
          </p>
          
          <p>
            The zlib compressed data format is described at
            <a href="http://www.ietf.org/rfc/rfc1950.txt" target="external">http://www.ietf.org/rfc/rfc1950.txt</a>
            .
          </p>
          
          <p>
            The deflate compression algorithm is described at
            <a href="http://www.ietf.org/rfc/rfc1951.txt" target="external">http://www.ietf.org/rfc/rfc1951.txt</a>
            .
          </p>
          
          <p>
            In order to decode data compressed in a format that uses the deflate compression algorithm, 
  such as data in gzip or zip format, it will not work to call
            <code>uncompress(CompressionAlgorithm.DEFLATE)</code>
            on 
  a ByteArray containing the compression formation data. First, you must separate the metadata that is 
  included as part of the compressed data format from the actual compressed data. For more 
  information, see the
            <code>compress()</code>
            method description.
          </p>
          
        </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">algorithm</span>:<a href="../../String.html">String</a></code> (default = <code>NaN</code>)<code></code> &mdash; 
              The compression algorithm to use when decompressing. This must be the 
  same compression algorithm used to compress the data. Valid values are defined as
  constants in the CompressionAlgorithm class. The default is to use zlib format. This parameter
  is only recognized for content running in Adobe AIR.
              <span>Flash Player 
  supports only the default algorithm, zlib, and throws an exception if you attempt to pass
  a value for this parameter.</span>
              
            </td></tr></table></p><br/><span class="label">Throws</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../flash/errors/IOError.html">IOError</a> </code> &mdash; The data is not valid compressed data; it was not compressed with the 
  same compression algorithm used to compress.</td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="ByteArray.html#compress()" target="">compress()</a><br/><a href="CompressionAlgorithm.html" target="">flash.utils.CompressionAlgorithm</a></div></div><a name="writeBoolean()"></a><a name="writeBoolean(Boolean)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">writeBoolean</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function writeBoolean(value:<a href="../../Boolean.html">Boolean</a>):<a href="../../specialTypes.html#void">void</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Writes a Boolean value. A single byte is written according to the
          <code>value</code>
          parameter,
  either 1 if
          <code>true</code>
          or 0 if
          <code>false</code>
          .
        </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">value</span>:<a href="../../Boolean.html">Boolean</a></code> &mdash; 
              A Boolean value determining which byte is written. If the parameter is
              <code>true</code>
              ,
  the method writes a 1; if
              <code>false</code>
              , the method writes a 0.
            </td></tr></table></p></div><a name="writeByte()"></a><a name="writeByte(int)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">writeByte</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function writeByte(value:<a href="../../int.html">int</a>):<a href="../../specialTypes.html#void">void</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Writes a byte to the byte stream.
          <p>The low 8 bits of the
  parameter are used. The high 24 bits are ignored.</p>
          
        </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">value</span>:<a href="../../int.html">int</a></code> &mdash; A 32-bit integer. The low 8 bits are written to the byte stream.</td></tr></table></p></div><a name="writeBytes()"></a><a name="writeBytes(flash.utils.ByteArray,uint,uint)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">writeBytes</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function writeBytes(bytes:<a href="../../flash/utils/ByteArray.html">ByteArray</a>, offset:<a href="../../uint.html">uint</a> = 0, length:<a href="../../uint.html">uint</a> = 0):<a href="../../specialTypes.html#void">void</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Writes a sequence of
          <code>length</code>
          bytes from the
  specified byte array,
          <code>bytes</code>
          ,
  starting
          <code>offset</code>
          (zero-based index) bytes
  into the byte stream.
          <p>
            If the
            <code>length</code>
            parameter is omitted, the default
  length of 0 is used; the method writes the entire buffer starting at
            <code>offset</code>
            .
  If the
            <code>offset</code>
            parameter is also omitted, the entire buffer is
  written.
          </p>
          
          <p>
            If
            <code>offset</code>
            or
            <code>length</code>
            is out of range, they are clamped to the beginning and end
  of the
            <code>bytes</code>
            array.
          </p>
          
        </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">bytes</span>:<a href="../../flash/utils/ByteArray.html">ByteArray</a></code> &mdash; The ByteArray object.</td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20px"></td><td><code><span class="label">offset</span>:<a href="../../uint.html">uint</a></code> (default = <code>0</code>)<code></code> &mdash; A zero-based index indicating the position into the array to begin writing.</td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20px"></td><td><code><span class="label">length</span>:<a href="../../uint.html">uint</a></code> (default = <code>0</code>)<code></code> &mdash; An unsigned integer indicating how far into the buffer to write.</td></tr></table></p></div><a name="writeDouble()"></a><a name="writeDouble(Number)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">writeDouble</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function writeDouble(value:<a href="../../Number.html">Number</a>):<a href="../../specialTypes.html#void">void</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>Writes an IEEE 754 double-precision (64-bit) floating-point number to the byte stream.</p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">value</span>:<a href="../../Number.html">Number</a></code> &mdash; A double-precision (64-bit) floating-point number.</td></tr></table></p></div><a name="writeFloat()"></a><a name="writeFloat(Number)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">writeFloat</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function writeFloat(value:<a href="../../Number.html">Number</a>):<a href="../../specialTypes.html#void">void</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>Writes an IEEE 754 single-precision (32-bit) floating-point number to the byte stream.</p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">value</span>:<a href="../../Number.html">Number</a></code> &mdash; A single-precision (32-bit) floating-point number.</td></tr></table></p></div><a name="writeInt()"></a><a name="writeInt(int)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">writeInt</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function writeInt(value:<a href="../../int.html">int</a>):<a href="../../specialTypes.html#void">void</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>Writes a 32-bit signed integer to the byte stream.</p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">value</span>:<a href="../../int.html">int</a></code> &mdash; An integer to write to the byte stream.</td></tr></table></p></div><a name="writeMultiByte()"></a><a name="writeMultiByte(String,String)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">writeMultiByte</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function writeMultiByte(value:<a href="../../String.html">String</a>, charSet:<a href="../../String.html">String</a>):<a href="../../specialTypes.html#void">void</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>Writes a multibyte string to the byte stream using the specified character set.</p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">value</span>:<a href="../../String.html">String</a></code> &mdash; The string value to be written.</td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20px"></td><td><code><span class="label">charSet</span>:<a href="../../String.html">String</a></code> &mdash; 
              The string denoting the character set to use. Possible character set strings
  include
              <code>"shift-jis"</code>
              ,
              <code>"cn-gb"</code>
              ,
              <code>"iso-8859-1"</code>
              , and others.
  For a complete list, see
              <a href="../../charset-codes.html" target="">Supported Character Sets</a>
              .
            </td></tr></table></p></div><a name="writeObject()"></a><a name="writeObject()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">writeObject</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function writeObject(object:<a href="../../specialTypes.html#*">*</a>):<a href="../../specialTypes.html#void">void</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>Writes an object into the byte array in AMF
  serialized format.</p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">object</span>:<a href="../../specialTypes.html#*">*</a></code> &mdash; The object to serialize.</td></tr></table></p><p><span class="label">See also</span></p><div class="seeAlso"><a href="../../flash/net/package.html#registerClassAlias()" target="">flash.net.registerClassAlias()</a></div></div><a name="writeShort()"></a><a name="writeShort(int)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">writeShort</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function writeShort(value:<a href="../../int.html">int</a>):<a href="../../specialTypes.html#void">void</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>Writes a 16-bit integer to the byte stream. The low 16 bits of the parameter are used. 
  The high 16 bits are ignored.</p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">value</span>:<a href="../../int.html">int</a></code> &mdash; 32-bit integer, whose low 16 bits are written to the byte stream.</td></tr></table></p></div><a name="writeUnsignedInt()"></a><a name="writeUnsignedInt(uint)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">writeUnsignedInt</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function writeUnsignedInt(value:<a href="../../uint.html">uint</a>):<a href="../../specialTypes.html#void">void</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>Writes a 32-bit unsigned integer to the byte stream.</p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">value</span>:<a href="../../uint.html">uint</a></code> &mdash; An unsigned integer to write to the byte stream.</td></tr></table></p></div><a name="writeUTF()"></a><a name="writeUTF(String)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">writeUTF</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function writeUTF(value:<a href="../../String.html">String</a>):<a href="../../specialTypes.html#void">void</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>Writes a UTF-8 string to the byte stream. The length of the UTF-8 string in bytes 
  is written first, as a 16-bit integer, followed by the bytes representing the 
  characters of the string.</p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">value</span>:<a href="../../String.html">String</a></code> &mdash; The string value to be written.</td></tr></table></p><br/><span class="label">Throws</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../RangeError.html">RangeError</a> </code> &mdash; If the length is larger than
  65535.</td></tr></table></div><a name="writeUTFBytes()"></a><a name="writeUTFBytes(String)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">writeUTFBytes</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function writeUTFBytes(value:<a href="../../String.html">String</a>):<a href="../../specialTypes.html#void">void</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Writes a UTF-8 string to the byte stream. Similar to the
          <code>writeUTF()</code>
          method,
  but
          <code>writeUTFBytes()</code>
          does not prefix the string with a 16-bit length word.
        </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">value</span>:<a href="../../String.html">String</a></code> &mdash; The string value to be written.</td></tr></table></p></div><a name="includeExamplesSummary"></a><div class="detailSectionHeader">Examples<span class="usage"><a href="../../ExampleInstruct.html"> How to use examples </a></span></div><div class="exampleHeader">ByteArrayExample.as</div><br/><div class="detailBody">
        The following example uses the class
        <code>ByteArrayExample</code>
        to write a Boolean
 and the double-precision floating-point representation of pi to a byte array.  This is accomplished 
 using the following steps:
        <ol><li>
            Declare a new ByteArray object instance
            <code>byteArr</code>
            .
          </li><li>
            Write the byte-equivalent value of the Boolean
            <code>false</code>
            and then check the length and 
 	read it back.
          </li><li>Write the double-precision floating-point equivalent of the mathematical value of pi.</li><li>Read back each of the nine bytes written into the byte array.</li></ol>
        
        <p>
          <b>Note:</b>
          when
          <code>trace()</code>
          is called on a byte, it prints the decimal equivalent
 of the bytes stored in the byte array.
        </p>
        
        <p>Notice how a code segment is added at the end to check for end of file errors to ensure that
 the byte stream is not read past its end.</p>
        
        <div class="listing"><pre>package {
    import flash.display.Sprite;
    import flash.utils.ByteArray;
    import flash.errors.EOFError;

    public class ByteArrayExample extends Sprite {        
        public function ByteArrayExample() {
            var byteArr:ByteArray = new ByteArray();

            byteArr.writeBoolean(false);
            trace(byteArr.length);            // 1
            trace(byteArr[0]);            // 0

            byteArr.writeDouble(Math.PI);
            trace(byteArr.length);            // 9
            trace(byteArr[0]);            // 0
            trace(byteArr[1]);            // 64
            trace(byteArr[2]);            // 9
            trace(byteArr[3]);            // 33
            trace(byteArr[4]);            // 251
            trace(byteArr[5]);            // 84
            trace(byteArr[6]);            // 68
            trace(byteArr[7]);            // 45
            trace(byteArr[8]);            // 24
            
            byteArr.position = 0;

            try {
                trace(byteArr.readBoolean() == false); // true
            } 
            catch(e:EOFError) {
                trace(e);           // EOFError: Error #2030: End of file was encountered.
            }
            
            try {
                trace(byteArr.readDouble());        // 3.141592653589793
            }
            catch(e:EOFError) {
                trace(e);           // EOFError: Error #2030: End of file was encountered.
            }
            
            try {
                trace(byteArr.readDouble());
            } 
            catch(e:EOFError) {
                trace(e);            // EOFError: Error #2030: End of file was encountered.
            }
        }
    }
}</pre></div>
      </div><br/><br/><hr><br/><p></p><center class="copyright"> &copy; 2004-2008 Adobe Systems Incorporated. All rights reserved. <br/>Thu Oct 30 2008, 07:08 PM -07:00  </center><div style="display:none">ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray ByteArray </div><div style="display:none">flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray flash.utils.ByteArray </div></div></body></html><!-- &copy; 2004-2008 Adobe Systems Incorporated. All rights reserved. <br/>Thu Oct 30 2008, 07:08 PM -07:00  -->
