Java ByteBuffer Get getByte(ByteBuffer byteBuffer)

Here you can find the source of getByte(ByteBuffer byteBuffer)

Description

get Byte

License

Apache License

Declaration

public static short getByte(ByteBuffer byteBuffer) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.nio.ByteBuffer;

public class Main {
    private static final int BYTE_PADDING = 0xFF;

    public static short getByte(ByteBuffer byteBuffer) {
        return (short) (byteBuffer.get() & BYTE_PADDING);
    }//from ww w .java2s  . co m

    public static short getByte(ByteBuffer byteBuffer, int position) {
        return (short) (byteBuffer.get(position) & (short) BYTE_PADDING);
    }
}

Related

  1. getBoolean(ByteBuffer bytes)
  2. getBoolean(java.nio.ByteBuffer buffer)
  3. getBuffer(ByteBuffer buffer, int len)
  4. getBufferBytes(ByteBuffer bb)
  5. getByte(ByteBuffer bb)
  6. getByteAsShort(java.nio.ByteBuffer buffer)
  7. getByteLen(ByteBuffer buffer)
  8. getChars(ByteBuffer buf, int off, int count)
  9. getCPCharacter(ByteBuffer buffer)