Android ByteBuffer Get getUnsignedByte(final ByteBuffer pByteBuffer, final int pPosition)

Here you can find the source of getUnsignedByte(final ByteBuffer pByteBuffer, final int pPosition)

Description

get Unsigned Byte

Declaration

public static short getUnsignedByte(final ByteBuffer pByteBuffer,
            final int pPosition) 

Method Source Code

//package com.java2s;
import java.nio.ByteBuffer;

public class Main {
    public static short getUnsignedByte(final ByteBuffer pByteBuffer) {
        return (short) (pByteBuffer.get() & 0xFF);
    }//from   w  w w  .ja v  a 2 s  . c  o  m

    public static short getUnsignedByte(final ByteBuffer pByteBuffer,
            final int pPosition) {
        return (short) (pByteBuffer.get(pPosition) & (short) 0xFF);
    }
}

Related

  1. getUnsignedByte(final ByteBuffer pByteBuffer)
  2. getUnsignedInt(final ByteBuffer pByteBuffer)
  3. getUnsignedInt(final ByteBuffer pByteBuffer, final int pPosition)
  4. extractNullTerminatedString(ByteBuffer bb)
  5. allocateMore(ByteBuffer output)