Java ByteBuffer Read readAlexString(ByteBuffer buffer)

Here you can find the source of readAlexString(ByteBuffer buffer)

Description

read Alex String

License

Open Source License

Declaration

public final static String readAlexString(ByteBuffer buffer) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.nio.ByteBuffer;

public class Main {
    public final static String readAlexString(ByteBuffer buffer) {
        int count = buffer.get() & 0xfff;
        byte bytes[] = new byte[count];
        buffer.get(bytes, 0, count);/*from   w w w  .j  a va  2 s  .c  o  m*/
        return new String(bytes);
    }
}

Related

  1. read(ByteBuffer dest, ByteBuffer src)
  2. read(ByteBuffer src, int len)
  3. read(final ByteBuffer buffer, final byte marker)
  4. read(SocketChannel p_channel, SSLEngine p_sslEngine, ByteBuffer p_inAppBuf, ByteBuffer p_inNetBuf)
  5. readableBytes(ByteBuffer buffer)
  6. readAllLeftBytes(ByteBuffer buffer)
  7. readASCII(ByteBuffer buffer)
  8. readAsciiString(MappedByteBuffer buffer, int pos, int length)
  9. readBE(ByteBuffer bb, int elementWidth)