Java ByteBuffer to Short Array getShort(ByteBuffer b, int n)

Here you can find the source of getShort(ByteBuffer b, int n)

Description

get Short

License

Apache License

Declaration

public static short[] getShort(ByteBuffer b, int n) 

Method Source Code


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

import java.nio.ByteBuffer;

public class Main {
    public static short[] getShort(ByteBuffer b, int n) {
        short s[] = new short[n];
        for (int k = 0; k < s.length; k++) {
            s[k] = b.getShort();/*from  w  w  w  .  jav  a  2  s . co  m*/
        }
        return s;
    }
}

Related

  1. getShort(ByteBuffer bb)
  2. getShort(ByteBuffer buffer)
  3. getShort(ByteBuffer byteBuffer)
  4. getShortB(ByteBuffer bb, int bi)