1<!--$Id: byteorder.so,v 10.17 2001/02/15 22:21:13 bostic Exp $--> 2<!--Copyright (c) 1997,2008 Oracle. All rights reserved.--> 3<!--See the file LICENSE for redistribution information.--> 4<html> 5<head> 6<title>Berkeley DB Reference Guide: Selecting a byte order</title> 7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit."> 8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++"> 9</head> 10<body bgcolor=white> 11<a name="2"><!--meow--></a> 12<table width="100%"><tr valign=top> 13<td><b><dl><dt>Berkeley DB Reference Guide:<dd>Access Methods</dl></b></td> 14<td align=right><a href="../am_conf/cachesize.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../am_conf/dup.html"><img src="../../images/next.gif" alt="Next"></a> 15</td></tr></table> 16<p align=center><b>Selecting a byte order</b></p> 17<p>Database files created by Berkeley DB can be created in either little- or 18big-endian formats. The byte order used for the underlying database 19is specified by calling the <a href="../../api_c/db_set_lorder.html">DB->set_lorder</a> method. If no order 20is selected, the native format of the machine on which the database is 21created will be used.</p> 22<p>Berkeley DB databases are architecture independent, and any format database can 23be used on a machine with a different native format. In this case, as 24each page that is read into or written from the cache must be converted 25to or from the host format, and databases with non-native formats will 26incur a performance penalty for the run-time conversion.</p> 27<p><b>It is important to note that the Berkeley DB access methods do no data 28conversion for application specified data. Key/data pairs written on a 29little-endian format architecture will be returned to the application 30exactly as they were written when retrieved on a big-endian format 31architecture.</b></p> 32<table width="100%"><tr><td><br></td><td align=right><a href="../am_conf/cachesize.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../am_conf/dup.html"><img src="../../images/next.gif" alt="Next"></a> 33</td></tr></table> 34<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 35</body> 36</html> 37