Java CharBuffer eraseCharBuffer(CharBuffer buffer)

Here you can find the source of eraseCharBuffer(CharBuffer buffer)

Description

erase Char Buffer

License

LGPL

Declaration

public static void eraseCharBuffer(CharBuffer buffer) 

Method Source Code

//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;
    }
}

Related

  1. asChars(CharBuffer buffer)
  2. capacityRemaining(CharBuffer buffer)
  3. charBufferToChars(CharBuffer buffer)
  4. consume(CharBuffer buf, boolean trim)
  5. convertCharBufferToArray(java.nio.CharBuffer buf)
  6. extendBuffer(CharBuffer buffer, int size)
  7. getCharsFromBufferAndReset(CharBuffer buffer)
  8. nextEquals(final CharBuffer buffer, final char next)
  9. printBuffer(CharBuffer charBuffer)