Here you can find the source of writeSlice(ByteBuffer src, int number, ByteBuffer dst)
public static void writeSlice(ByteBuffer src, int number, ByteBuffer dst)
//package com.java2s; // Licensed under the MIT License: import java.nio.ByteBuffer; public class Main { public static void writeSlice(ByteBuffer src, int number, ByteBuffer dst) { //writes a slice of an input buffer to an output buffer ByteBuffer slice = src.slice(); slice.limit(number);// w ww. ja va2 s .c om dst.put(slice); } }