C# (CSharp) CSJ2K.j2k.util Пространство имен

Классы

Имя Описание
CodestreamManipulator This class takes a legal JPEG 2000 codestream and performs some manipulation on it. Currently the manipulations supported are: Tile-parts
FacilityManager This class manages common facilities for multi-threaded environments, It can register different facilities for each thread, and also a default one, so that they can be referred by static methods, while possibly having different ones for different threads. Also a default facility exists that is used for threads for which no particular facility has been registerd registered.

Currently the only kind of facilities managed is MsgLogger.

An example use of this class is if 2 instances of a decoder are running in different threads and the messages of the 2 instances should be separated.

The default MsgLogger is a StreamMsgLogger that uses System.out as the 'out' stream and System.err as the 'err' stream, and a line width of 78. This can be changed using the registerMsgLogger() method.

ISRandomAccessIO This class implements a wrapper to turn an InputStream into a RandomAccessIO. To provide random access, the input data from the InputStream is cached in an in-memory buffer. The in-memory buffer size can be limited to a specified size. The data is read into the cache on a as needed basis, blocking only when necessary.

The cache grows automatically as necessary. However, if the data length is known prior to the creation of a ISRandomAccessIO object, it is best to specify that as the initial in-memory buffer size. That will minimize data copying and multiple allocation.

Multi-byte data is read in big-endian order. The in-memory buffer storage is released when 'close()' is called. This class can only be used for data input, not output. The wrapped InputStream is closed when all the input data is cached or when 'close()' is called.

If an out of memory condition is encountered when growing the in-memory buffer an IOException is thrown instead of an OutOfMemoryError. The exception message is "Out of memory to cache input data".

This class is intended for use as a "quick and dirty" way to give network connectivity to RandomAccessIO based classes. It is not intended as an efficient means of implementing network connectivity. Doing such requires reimplementing the RandomAccessIO based classes to directly use network connections.

This class does not use temporary files as buffers, because that would preclude the use in unsigned applets.

MathUtil This class contains a collection of utility methods fro mathematical operations. All methods are static.
MsgLogger_Fields This class provides a simple common abstraction of a facility that logs and/or displays messages or simple strings. The underlying facility can be a terminal, text file, text area in a GUI display, dialog boxes in a GUI display, etc., or a combination of those.

Messages are short strings (a couple of lines) that indicate some state of the program, and that have a severity code associated with them (see below). Simple strings is text (can be long) that has no severity code associated with it. Typical use of simple strings is to display help texts.

Each message has a severity code, which can be one of the following: LOG, INFO, WARNING, ERROR. Each implementation should treat each severity code in a way which corresponds to the type of diplay used.

Messages are printed via the 'printmsg()' method. Simple strings are printed via the 'print()', 'println()' and 'flush()' methods, each simple string is considered to be terminated once the 'flush()' method has been called. The 'printmsg()' method should never be called before a previous simple string has been terminated.

StreamMsgLogger This class implements the MsgLogger interface for streams. Streams can be simple files, terminals, stdout, stderr, etc. The messages or simple strings are formatted using the linewidth given to the constructor.

Messages are printed to the 'err' stream if they are of severity WARNING or ERROR, otherwise they are printed to the 'out' stream. Simple strings are always printed the 'out' stream.

StringFormatException Thrown to indicate that the application has attempted to parse a badly formatted string.