# Package org.apache.commons.io

package org.apache.commons.io
Provides classes for working with streams, readers, writers and files. The most commonly used classes are described here:

IOUtils is the most frequently used class. It provides operations to read, write, copy and close streams.

FileUtils provides operations based around the JDK File class. These include reading, writing, copying, comparing and deleting.

FilenameUtils provides utilities based on filenames. This utility class manipulates file names without using File objects. It aims to simplify the transition between Windows and Unix. Before using this class however, you should consider whether you should be using File objects.

FileSystemUtils allows access to the filing system in ways the JDK does not support. At present this allows you to get the free space on a drive.

EndianUtils swaps data between Big-Endian and Little-Endian formats.

- Related Packages
  Package
  Description
  org.apache.commons.io.build
  Provides classes to implement IO builders.
  org.apache.commons.io.channels
  Provides classes to work with `java.nio.channels`.
  org.apache.commons.io.charset
  Provides classes to work with code from `java.nio.charset`.
  org.apache.commons.io.comparator
  Provides various `Comparator` implementations for `File`s and `Path`.
  org.apache.commons.io.file
  Provides extensions in the realm of `java.nio.file`.
  org.apache.commons.io.filefilter
  Provides the an interface `IOFileFilter` that combines both `FileFilter` and `FilenameFilter`.
  org.apache.commons.io.function
  Provides IO-only related functional interfaces for lambda expressions and method references.
  org.apache.commons.io.input
  Provides implementations of input classes, such as `InputStream` and `Reader`.
  org.apache.commons.io.monitor
  Provides a component for monitoring file system events (directory and file create, update and delete events).
  org.apache.commons.io.output
  Provides implementations of output classes, such as `OutputStream` and `Writer`.
  org.apache.commons.io.serialization
  Provides a framework for controlling the deserialization of classes.
- Class
  Description
  ByteBuffers
  Manufactures `ByteBuffer` instances.
  ByteOrderMark
  Byte Order Mark (BOM) representation.
  ByteOrderParser
  Converts Strings to `ByteOrder` instances.
  Charsets
  Charsets required of every implementation of the Java platform.
  CopyUtils
  Deprecated.
  Use IOUtils.
  DirectoryWalker<T>
  Deprecated.
  Apache Commons IO no longer uses this class.
  DirectoryWalker.CancelException
  CancelException is thrown in DirectoryWalker to cancel the current processing.
  EndianUtils
  Helps with reading and writing primitive numeric types (`short`, `int`, `long`, `float`, and `double`) that are encoded in little endian using two's complement or unsigned representations.
  FileCleaner
  Deprecated.
  Use `FileCleaningTracker`
  FileCleaningTracker
  Keeps track of files awaiting deletion, and deletes them when an associated marker object is reclaimed by the garbage collector.
  FileDeleteStrategy
  Strategy for deleting files.
  FileExistsException
  Indicates that a file already exists.
  FilenameUtils
  General file name and file path manipulation utilities.
  FileSystem
  Abstracts an OS' file system details, currently supporting the single use case of converting a file name String to a legal file name with `FileSystem.toLegalFileName(String, char)`.
  FileSystemUtils
  Deprecated.
  As of 2.6 deprecated without replacement.
  FileUtils
  General file manipulation utilities.
  HexDump
  Dumps data in hexadecimal format.
  IOCase
  Enumeration of IO case sensitivity.
  IOExceptionList
  An IOException based on a list of Throwable causes.
  IOExceptionWithCause
  Deprecated.
  (since 2.5) use `IOException` instead
  IOIndexedException
  A IOException associated with a source index.
  IORandomAccessFile
  Extends `RandomAccessFile` to provide access to the `File` and `mode` passed on construction.
  IOUtils
  General IO stream manipulation utilities.
  LineIterator
  An Iterator over the lines in a `Reader`.
  RandomAccessFileMode
  Enumerates access modes for `RandomAccessFile` with factory methods.
  RandomAccessFiles
  Works with `RandomAccessFile`.
  StandardLineSeparator
  Enumerates standard line separators: `StandardLineSeparator.CR`, `StandardLineSeparator.CRLF`, `StandardLineSeparator.LF`.
  StreamIterator<E>
  Wraps and presents a `Stream` as a `AutoCloseable` `Iterator` resource that automatically closes itself when reaching the end of stream.
  TaggedIOException
  An `IOException` decorator that adds a serializable tag to the wrapped exception.
  ThreadUtils
  Helps work with threads.