Java ByteBuffer Decode decodeASCII(ByteBuffer buffer, int length, int offset)

Here you can find the source of decodeASCII(ByteBuffer buffer, int length, int offset)

Description

decode ASCII

License

Open Source License

Declaration

static String decodeASCII(ByteBuffer buffer, int length, int offset) 

Method Source Code


//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);
    }
}

Related

  1. decode(ByteBuffer bb, CharsetDecoder decoder)
  2. decode(Charset charset, ByteBuffer buffer)
  3. decode(CharsetDecoder decoder, ByteBuffer src, CharBuffer dst)
  4. decode(String charsetName, ByteBuffer byteBuffer)
  5. decodeAlign(ByteBuffer buf)
  6. decodeBuffer(ByteBuffer buffer, String charsetName)
  7. decodeDouble(ByteBuffer bb)
  8. decodeInt(ByteBuffer buffer, int start)
  9. decodeIO(String encoding, ByteBuffer bbuf)