<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://www.jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java%2FFile_Input_Output%2FMappedByteBuffer</id>
		<title>Java/File Input Output/MappedByteBuffer - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java%2FFile_Input_Output%2FMappedByteBuffer"/>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java/File_Input_Output/MappedByteBuffer&amp;action=history"/>
		<updated>2026-04-21T18:45:24Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.jexp.ru/index.php?title=Java/File_Input_Output/MappedByteBuffer&amp;diff=6203&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java/File_Input_Output/MappedByteBuffer&amp;diff=6203&amp;oldid=prev"/>
				<updated>2010-06-01T06:04:06Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 06:04, 1 июня 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://www.jexp.ru/index.php?title=Java/File_Input_Output/MappedByteBuffer&amp;diff=6202&amp;oldid=prev</id>
		<title> в 18:01, 31 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java/File_Input_Output/MappedByteBuffer&amp;diff=6202&amp;oldid=prev"/>
				<updated>2010-05-31T18:01:43Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Map FileChannel to MappedByteBuffer ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
import java.io.FileInputStream;&lt;br /&gt;
import java.nio.MappedByteBuffer;&lt;br /&gt;
import java.nio.channels.FileChannel;&lt;br /&gt;
public class Main {&lt;br /&gt;
  public static void main(String args[]) throws Exception {&lt;br /&gt;
    String filename = args[0];&lt;br /&gt;
    int start = 10;&lt;br /&gt;
    int length = 20;&lt;br /&gt;
    FileInputStream fin = new FileInputStream(filename);&lt;br /&gt;
    FileChannel finc = fin.getChannel();&lt;br /&gt;
    MappedByteBuffer mbb = finc.map(FileChannel.MapMode.READ_ONLY, start, length);&lt;br /&gt;
    for (int i = 0; i &amp;lt; length; ++i) {&lt;br /&gt;
      System.out.println(mbb.get(i);&lt;br /&gt;
    }&lt;br /&gt;
    fin.close();&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Persisting Changes to a Memory-Mapped ByteBuffer ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
import java.io.File;&lt;br /&gt;
import java.io.RandomAccessFile;&lt;br /&gt;
import java.nio.MappedByteBuffer;&lt;br /&gt;
import java.nio.channels.FileChannel;&lt;br /&gt;
public class Main {&lt;br /&gt;
  public static void main(String[] argv) throws Exception {&lt;br /&gt;
    File file = new File(&amp;quot;filename&amp;quot;);&lt;br /&gt;
    FileChannel channel = new RandomAccessFile(file, &amp;quot;rw&amp;quot;).getChannel();&lt;br /&gt;
    MappedByteBuffer buf = channel.map(FileChannel.MapMode.READ_WRITE, 0, (int) channel.size());&lt;br /&gt;
    buf.put(0, (byte) 0xFF);&lt;br /&gt;
    buf.force();&lt;br /&gt;
    channel.close();&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Read file upside/down with RandomAccessFile ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
import java.io.RandomAccessFile;&lt;br /&gt;
import java.nio.MappedByteBuffer;&lt;br /&gt;
import java.nio.channels.FileChannel;&lt;br /&gt;
public class Main {&lt;br /&gt;
  public static void main(String[] args) throws Exception {&lt;br /&gt;
    RandomAccessFile f = new RandomAccessFile(&amp;quot;hello.txt&amp;quot;, &amp;quot;rw&amp;quot;);&lt;br /&gt;
    FileChannel fc = f.getChannel();&lt;br /&gt;
    MappedByteBuffer mbb = fc.map(FileChannel.MapMode.READ_WRITE, 0, f.length());&lt;br /&gt;
    int len = (int) f.length();&lt;br /&gt;
    for (int i = 0, j = len - 1; i &amp;lt; j; i++, j--) {&lt;br /&gt;
      byte b = mbb.get(i);&lt;br /&gt;
      mbb.put(i, mbb.get(j));&lt;br /&gt;
      mbb.put(j, b);&lt;br /&gt;
    }&lt;br /&gt;
    fc.close();&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;/div&gt;</summary>
			</entry>

	</feed>