Here you can find the source of skipBytes(ByteBuffer buf, int count)
Parameter | Description |
---|---|
buf | The ByteBuffer to change the position of. |
count | The number of bytes to skip. |
Parameter | Description |
---|---|
IllegalArgumentException | if the buffer's current position plusthe count is either negative or greater than the buffer's limit. |
public static void skipBytes(ByteBuffer buf, int count)
//package com.java2s; //License from project: Open Source License import java.nio.ByteBuffer; public class Main { /**/*from w ww . j a v a2 s. co m*/ * Skip a specified number of bytes, i.e., advance the buffer's position. * * @param buf The {@link ByteBuffer} to change the position of. * @param count The number of bytes to skip. * @throws IllegalArgumentException if the buffer's current position plus * the count is either negative or greater than the buffer's limit. */ public static void skipBytes(ByteBuffer buf, int count) { buf.position(buf.position() + count); } }