Java tutorial
import java.nio.ShortBuffer; import java.util.Arrays; public class Main { public static void main(String[] args) { ShortBuffer shortBuffer = ShortBuffer.allocate(10); shortBuffer.put((short) 100); shortBuffer.rewind(); ShortBuffer shortBuffer2 = shortBuffer.slice(); System.out.println(shortBuffer2.equals(shortBuffer2)); } }