Here you can find the source of charBufferToChars(CharBuffer buffer)
Parameter | Description |
---|---|
buffer | a parameter |
public static char[] charBufferToChars(CharBuffer buffer)
//package com.java2s; //License from project: LGPL import java.nio.CharBuffer; import java.util.Arrays; public class Main { /**/*from w ww .j a v a2 s .c om*/ * @param buffer * @return */ public static char[] charBufferToChars(CharBuffer buffer) { final char[] array = buffer.array(); final int arrayOffset = buffer.arrayOffset(); return Arrays.copyOfRange(array, arrayOffset + buffer.position(), arrayOffset + buffer.limit()); } }