import java.nio.*; import java.nio.ShortBuffer; public class WrapShortBuffer { public static void main(String[] arg) { short[] array = new short[] { 12, 34, 56 }; ShortBuffer shortBuff = ShortBuffer.wrap(array); System.out.println("Limit of short buffer : " + shortBuff.limit()); System.out .println("capacity of short buffer : " + shortBuff.capacity()); System.out.println("Content in shortbuffer."); while (shortBuff.hasRemaining()) { System.out.print(shortBuff.get() + " "); } } }