private void expandBuffer(int newBufferSize){
  ByteBuffer newBuffer=ByteBuffer.allocate(newBufferSize);
  int oldPosition=mBuffer.position();
  mBuffer.position(0);
  newBuffer.put(mBuffer);
  newBuffer.position(oldPosition);
  mBuffer=newBuffer;
}

private void expandBuffer ( int newBufferSize ) { ByteBuffer newBuffer = ByteBuffer . allocate ( newBufferSize ) ; int oldPosition = mBuffer . position ( ) ; mBuffer . position ( 0 ) ; newBuffer . put ( mBuffer ) ; newBuffer . position ( oldPosition ) ; mBuffer = newBuffer ; }
expand the size of the internal buffer .
