Code example for ByteBuffer

Methods: getShort, order

0
    public short colormap;
 
    @Override 
    public void unpack(ByteBuffer buf)
            throws IOException { 
        buf.order(ByteOrder.LITTLE_ENDIAN);
        originx = buf.getShort();
        originy = buf.getShort();
        patch = buf.getShort();
        stepdir = buf.getShort();
        colormap = buf.getShort();
    } 
 
    public static final int size() { 
        return 10; 
    } 
 
 
};