Here you can find the source of clear(ByteBuffer buffer)
Parameter | Description |
---|---|
buffer | The buffer to clear. |
public static void clear(ByteBuffer buffer)
//package com.java2s; // are made available under the terms of the Eclipse Public License v1.0 import java.nio.ByteBuffer; public class Main { /** Clear the buffer to be empty in flush mode. * The position and limit are set to 0; * @param buffer The buffer to clear. *//*from ww w .j a v a 2 s . com*/ public static void clear(ByteBuffer buffer) { if (buffer != null) { buffer.position(0); buffer.limit(0); } } }