Package org.jdtaus.core.io.util

System input and output utility components.

See: Description

Package org.jdtaus.core.io.util Description

Package class diagram package org.jdtaus.core.io.util
System input and output utility components.

This package provides general purpose I/O utility components. The MemoryFileOperations class can be used as a FileOperations implementation performing I/O in memory without actually performing any real system I/O at all. It is best used for small amounts of data which can be obtained as an array of bytes easily. The RandomAccessFileOperations class can be used as a FileOperations implementation performing real system I/O backed by a RandomAccessFile.

When writing I/O intensive applications cacheing may become a concern. This package provides two general purpose cache implementations for use with FileOperations implementations. The ReadAheadFileOperations cache implementation may reduce I/O when reading most of the time. The CoalescingFileOperations cache implementation may reduce I/O when writing most of the time. In rare circumstances a combination of the two implementations may also reduce I/O. Cacheing should be used with caution. It may not be the correct way to solve a problem which could be solved elsewhere in a more efficient way. If performance degradation is encountered with an application caused by too much I/O operations, the following considerations should be taken into account, before using any of the provided cache implementations. First of all, try to reduce the number of I/O operations by carefully reviewing your application. Collect some profiling results at this point. Only if you see no way in decreasing the number of I/O operations performed by the application, consider using one of the provided cache implementations. Use the ReadAheadFileOperations implementation if reading most of the time and the CoalescingFileOperations implementation if writing most of the time to reduce I/O gaining more throughput. Make sure to always measure the results and compare with what you collected without cacheing. Note that hardware has a huge impact on the effect of applying cacheing. Both cache implementations will reduce I/O usage by increasing CPU usage. A system with, for example, a fast harddisk but slow CPU may not benefit from applying a cache. The situation may even get worse.

Copyright © 2005-2012 jDTAUS. All Rights Reserved.