Subclasses call this method to initialize the BufferedFile.
543424
def _set_mode(self, mode='r', bufsize=-1):
        
        # set bufsize in any event, because it's used for readline().
        self._bufsize = self._DEFAULT_BUFSIZE
        if bufsize < 0:
            # do no buffering by default, because otherwise writes will get
            # buffered in a way that will probably confuse people.
            bufsize = 0
        if bufsize == 1:
            # apparently, line buffering only affects writes.  reads are only
            # buffered if you call readline (directly or indirectly: iterating
            # over a file will indirectly call readline).
            self._flags |= self.FLAG_BUFFERED | self.FLAG_LINE_BUFFERED
        elif bufsize > 1:
            self._bufsize = bufsize
            self._flags |= self.FLAG_BUFFERED
            self._flags &= ~self.FLAG_LINE_BUFFERED
        elif bufsize == 0:
            # unbuffered
            self._flags &= ~(self.FLAG_BUFFERED | self.FLAG_LINE_BUFFERED)

        if ('r' in mode) or ('+' in mode):
            self._flags |= self.FLAG_READ
        if ('w' in mode) or ('+' in mode):
            self._flags |= self.FLAG_WRITE
        if ('a' in mode):
            self._flags |= self.FLAG_WRITE | self.FLAG_APPEND
            self._size = self._get_size()
            self._pos = self._realpos = self._size
        if ('b' in mode):
            self._flags |= self.FLAG_BINARY
        if ('U' in mode):
            self._flags |= self.FLAG_UNIVERSAL_NEWLINE
            # built-in file objects have this attribute to store which kinds of
            # line terminations they've seen:
            # <http://www.python.org/doc/current/lib/built-in-funcs.html>
            self.newlines = None
210130
public void readyToWrite()
    {
        addSignatureIfNeed();
        this.name_index = ((SubClass)classFile).resolveNameIndex(getSimpleName());
        this.descriptor_index = ((SubClass)classFile).resolveNameIndex(Descriptor.getDesriptor(this));
        readyToWrite = true;
    }
625147
public void init(Record thisFile, String userIdFieldName, boolean bFirstTimeOnly)
    {
        super.init(thisFile);
        this.userIdFieldName = userIdFieldName;
        m_bFirstTimeOnly = bFirstTimeOnly;
    }
1013943
protected function onInit()
    {
        $this->filePath = Utility::get($this->params, "filePath");
        $this->fieldSeparator = Utility::get($this->params, "fieldSeparator", ",");
        $this->charset = Utility::get($this->params, "charset");
        $this->precision = Utility::get($this->params, "precision", 100);
        $this->firstRowData = Utility::get($this->params, "firstRowData", false);
    }
247950
public void initialize() {
		this.enqueue(new SerialMessage(SerialMessage.SerialMessageClass.GetVersion, SerialMessage.SerialMessageType.Request, SerialMessage.SerialMessageClass.GetVersion, SerialMessage.SerialMessagePriority.High));
		this.enqueue(new SerialMessage(SerialMessage.SerialMessageClass.MemoryGetId, SerialMessage.SerialMessageType.Request, SerialMessage.SerialMessageClass.MemoryGetId, SerialMessage.SerialMessagePriority.High));
		this.enqueue(new SerialMessage(SerialMessage.SerialMessageClass.SerialApiGetCapabilities, SerialMessage.SerialMessageType.Request, SerialMessage.SerialMessageClass.SerialApiGetCapabilities, SerialMessage.SerialMessagePriority.High));
	}
1186406
protected static function init(): void
    {
        if (!static::$initialized) {
            $baseClass = Base::getInstance();
            static::$initialized = true;
            static::$newDirectoryMode = \octdec((string)$baseClass->Filesystem->newDirectoryMode);
            static::$newFileMode = \octdec((string)$baseClass->Filesystem->newFileMode);
            static::$writeLocks = (boolean)$baseClass->Filesystem->writeLocks;
            static::$hashFileDir = $baseClass->parsePath((string)$baseClass->Filesystem->hashFileDirectory);
            static::$hashFileDirDepth = (int)$baseClass->Filesystem->hashFileDirectoryDepth;
            static::$documentRoot = $baseClass->parsePath('%DOCUMENT_ROOT%').DIRECTORY_SEPARATOR;
        }
    }
871016
public void initialize ()
  {
    m_aLoadHelpers = new CommonsArrayList <> ();
    m_aLoadHelpers.add (new LoadingLoaderClassLoadHelper ());
    m_aLoadHelpers.add (new SimpleClassLoadHelper ());
    m_aLoadHelpers.add (new ThreadContextClassLoadHelper ());
    m_aLoadHelpers.add (new InitThreadContextClassLoadHelper ());

    for (final IClassLoadHelper aLoadHelper : m_aLoadHelpers)
      aLoadHelper.initialize ();
  }
210383
private void postInitialize() {
        if (log.isDebugEnabled()) {
            log.debug("FLVReader 1 - Buffer size: {} position: {} remaining: {}", new Object[] { getTotalBytes(), getCurrentPosition(), getRemainingBytes() });
        }
        if (getRemainingBytes() >= 9) {
            decodeHeader();
        }
        if (file != null) {
            keyframeMeta = analyzeKeyFrames();
        }
        long old = getCurrentPosition();
        log.debug("Position: {}", old);
    }
1040576
protected void init() throws IOException {
        try {
            long lwmScn = _arrayFile.getLwmScn();
            long hwmScn = _arrayFile.getHwmScn();
            if (hwmScn < lwmScn) {
                throw new IOException(_arrayFile.getAbsolutePath() + " is corrupted: lwmScn=" + lwmScn + " hwmScn=" + hwmScn);
            }

            // Initialize entry manager and process entry files on disk if any.
            _entryManager.init(lwmScn, hwmScn);

            // Load data from the array file on disk.
            loadArrayFileData();
        } catch (IOException e) {
            _entryManager.clear();
            getLogger().error(e.getMessage(), e);
            throw e;
        }
    }
350292
public void init(Object data, int iFieldsTypes)
    {
        if (data == null)
            this.clearBuffer();
        else
        {
            m_iHeaderCount = 0;
            this.setPhysicalData(data);
            this.resetPosition();
        }
        m_iFieldsTypes = iFieldsTypes;      // Default - assume all fields (call bufferToFields(xxx, false) if not)
    }
407391
protected final void init() {
        checkState(!initialized, "initialized already");
        Throwable cause = null;
        try {
            final File[] childFiles = rootDir.listFiles();
            if (childFiles != null) {
                for (File f : childFiles) {
                    loadChild(f);
                }
            }
            initialized = true;
        } catch (Throwable t) {
            cause = t;
        }

        if (cause != null) {
            final CentralDogmaException finalCause;
            if (cause instanceof CentralDogmaException) {
                finalCause = (CentralDogmaException) cause;
            } else {
                finalCause = new CentralDogmaException("Failed to load a child: " + cause, cause);
            }
            close(() -> finalCause);
            throw finalCause;
        }
    }
542068
private void initOut() throws IOException
   {
      if (out == null)
      {
         FileOutputStream os = PrivilegedFileHelper.fileOutputStream(logFile, false);
         out = os.getChannel();
      }
   }
936787
public void init() {
        if (logger != null && StringUtils.isNotEmpty(name)) {
            if (logger.isWarnEnabled() && !ConfigUtils.isFilePath(name)) {
                try {
                    List<String> realPaths = new ArrayList<String>();
                    Enumeration<URL> e = Thread.currentThread().getContextClassLoader().getResources(name);
                    while (e.hasMoreElements()) {
                        URL url = (URL) e.nextElement();
                        realPaths.add(url.getFile());
                    }
                    if (realPaths.size() > 1) {
                        logger.warn("Multi httl config in classpath, conflict configs: " + realPaths + ". Please keep only one config.");
                    }
                } catch (IOException e) {
                    logger.error(e.getMessage(), e);
                }
            }
            if (logger.isInfoEnabled()) {
                String realPath = ConfigUtils.getRealPath(name);
                if (StringUtils.isNotEmpty(realPath)) {
                    logger.info("Load httl config from " + realPath + " in " + (name.startsWith("/") ? "filesystem" : "classpath") + ".");
                }
            }
        }
    }
466510
private boolean init() throws IOException, CompoundNotFoundException {

		BufferedReader br = new BufferedReader(new FileReader(file));
		br.skip(sequenceStartIndex);
		String sequence = sequenceParser.getSequence(br, sequenceLength);
		setContents(sequence);
		br.close(); // close file to prevent too many being open

		return true;
	}
523969
protected void init() {
        try {
            // Initialize the current working segment
            _segment = _segmentManager.nextSegment();
            
            // Segment index buffer is enabled by default!
            _sib = _segmentManager.openSegmentIndexBuffer(_segment.getSegmentId());
            if(!_sibEnabled) _sib.markAsDirty();
            
            _log.info("Segment " + _segment.getSegmentId() + " online: " + _segment.getStatus());
        } catch(IOException ioe) {
            _log.error(ioe.getMessage(), ioe);
            throw new SegmentException("Instantiation failed due to " + ioe.getMessage());
        }
    }
229300
public void init()
  {
    _offset = 0;

    if (_tempBuffer == null) {
      _tempBuffer = TempBuffer.create();
      _buffer = _tempBuffer.buffer();
      _bufferEnd = _buffer.length;
    }
  }
841740
public void initialize(){
    thread = new Thread(collectorProcessor);
    thread.start();
    for (DriverNode dn : this.children){
      dn.initialize();
    }
  }