Here you can find the source of eraseCharBuffer(CharBuffer buffer)
public static void eraseCharBuffer(CharBuffer buffer)
//package com.java2s; //License from project: LGPL import java.nio.CharBuffer; public class Main { public static void eraseCharBuffer(CharBuffer buffer) { char[] data = buffer.array(); long limit = buffer.arrayOffset() + buffer.limit(); for (int i = buffer.arrayOffset(); i < limit; i++) data[i] = 0xAA;// www. j ava 2s. c o m for (int i = buffer.arrayOffset(); i < limit; i++) data[i] = 0x55; for (int i = buffer.arrayOffset(); i < limit; i++) data[i] = 0x00; } }