Here you can find the source of decodeASCII(ByteBuffer buffer, int length, int offset)
static String decodeASCII(ByteBuffer buffer, int length, int offset)
//package com.java2s; /*/* w w w . j a v a 2s.c o m*/ * Copyright LWJGL. All rights reserved. * License terms: http://lwjgl.org/license.php */ import java.nio.ByteBuffer; public class Main { /** @see MemoryUtil#memASCII(ByteBuffer, int, int) */ static String decodeASCII(ByteBuffer buffer, int length, int offset) { char[] chars = new char[length]; for (int i = 0; i < length; i++) chars[i] = (char) buffer.get(offset + i); return new String(chars); } }