/**
  * Returns the maximum number of characters needed to convert a byte. Useful for calculating the
  * maximum output buffer size needed for a particular input buffer.
  */
 public int getMaxCharsPerByte() {
   if (decoder != null) return (int) Math.ceil(decoder.maxCharsPerByte());
   else // only provided for subclasses
   return 1;
   // Until UTF-16, this will do for every encoding
 }
Beispiel #2
0
 /** Returns the number of pages in this HeapFile. */
 public int numPages() {
   return (int) Math.ceil(m_file.length() / BufferPool.PAGE_SIZE);
 }