Java ByteBuffer to Short Array getShort(ByteBuffer byteBuffer)

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

Description

get Short

License

Apache License

Declaration

public static int getShort(ByteBuffer byteBuffer) 

Method Source Code


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

import java.nio.ByteBuffer;

public class Main {
    private static final int SHORT_PADDING = 0xFFFF;

    public static int getShort(ByteBuffer byteBuffer) {
        return (byteBuffer.getShort() & SHORT_PADDING);
    }/*from  w w  w  .j a v  a 2  s  .c om*/

    public static int getShort(ByteBuffer byteBuffer, int position) {
        return (byteBuffer.getShort(position) & SHORT_PADDING);
    }
}

Related

  1. getShort(ByteBuffer b, int n)
  2. getShort(ByteBuffer bb)
  3. getShort(ByteBuffer buffer)
  4. getShortB(ByteBuffer bb, int bi)
  5. getShortBE(ByteBuffer b, int start, int end)
  6. getShortBE(final ByteBuffer b, final int start, final int end)
  7. getShortLength(ByteBuffer bb)