Code example for CharBuffer

Methods: clear

0
    if (minBufferCap == -1)
      minBufferCap = DEFAULT_BUFFER_CAP;
    this.byteBuffer
      = ByteBuffer.allocate((int) (minBufferCap * enc.maxBytesPerChar()));
    this.charBuffer = CharBuffer.allocate(minBufferCap);
    this.charBuffer.clear();
  } 
 
  /* (non-Javadoc) 
   * @see java.io.Writer#flush() 
   */ 
  public void flush() throws IOException 
  { 
    // Presumably if we have characters in our buffer, it is 
    // due to an underflow.  So we don't bother trying to flush 
    // that here. 
  } 
 
  /* (non-Javadoc) 
   * @see java.io.Writer#close() 
   */