Here you can find the source of readUTFString(MappedByteBuffer mmap)
public static String readUTFString(MappedByteBuffer mmap)
//package com.java2s; import java.nio.MappedByteBuffer; import java.nio.charset.Charset; public class Main { public static String readUTFString(MappedByteBuffer mmap) { byte[] encodedString = new byte[mmap.getShort()]; mmap.get(encodedString);/*w ww .j a v a 2 s .co m*/ return new String(encodedString, Charset.forName("UTF-8")); } }