Here you can find the source of write(MappedByteBuffer buffer, int pos, String asciString)
public static void write(MappedByteBuffer buffer, int pos, String asciString)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); import java.nio.MappedByteBuffer; public class Main { public static void write(MappedByteBuffer buffer, int pos, String asciString) { byte[] bytes = asciString.getBytes(); for (int i = 0; i < bytes.length; ++i) { buffer.put(pos + i, bytes[i]); }/* w w w.j a v a2 s . c om*/ } public static void getBytes(MappedByteBuffer buffer, int pos, byte[] target) { for (int i = 0; i < target.length; ++i) { target[i] = buffer.get(pos + i); } } }