code: private synchronized PrintStream getPrintStream(long numNewChars, String header) {
          switch (currentStatus) {
              case INIT:
                  return createStream(header);
              case ACTIVE:
                  if (maxFileSizeBytes > 0) {
                      long bytesWritten = currentCountingStream.count();
  
                      // Replace the stream if the size is or will likely be
                      // exceeded.  We're estimating one byte per char, which is
                      // only accurate for single-byte character sets.  That's
                      // fine: if a multi-byte character set is being used and
                      // we underestimate the number of bytes that will be
                      // written, we'll roll the log next time
                      if (bytesWritten + numNewChars > maxFileSizeBytes) {
                          return createStream(header);
  
                      }
                  }
                  break;
          }
  
          return currentPrintStream;
      }
docs: Obtain the current printstream: called from synchronized methods
  
  @param requiredLength
  @return