Package org.jboss.vfs
Enum VirtualJarFileInputStream.State
- All Implemented Interfaces:
Serializable
,Comparable<VirtualJarFileInputStream.State>
,java.lang.constant.Constable
- Enclosing class:
VirtualJarFileInputStream
Basic state machine that will allow the process to transition between the different process states.
The following describes the process flow:
[NOT_STARTED] - Initial state
- Does not provide content
- Transitions [LOCAL_ENTRY_HEADER]
[LOCAL_ENTRY_HEADER] - The phase for reading the Local Directory Header
- Provides content of the local directory header by populating and feeding off a buffer
- Transitions to [ENTRY_CONTENT] if the header was written
- Transitions to [START_CENTRAL_DIRECTORY] if this is the last local entry header
[ENTRY_CONTENT] - The phase for reading the content of an entry
- Provides content of the entry using the VirtualJarInputStream
- Transitions to [LOCAL_ENTRY_HEADER]
[START_CENTRAL_DIRECTORY] - Phased used to transition into the central directory
- Does not provide content
- Transitions to [CENTRAL_ENTRY_HEADER]
[CENTRAL_ENTRY_HEADER] - The phase for reading the content of a single central directory header
- Provides content for the central directory header by feeding off a buffer
- Transitions to [CENTRAL_ENTRY_HEADER]
- Transitions to [CENTRAL_END] if there are no more entries
[CENTRAL_END] - The phase for reading the contents of the central directory end
- Provides content for central directory end by feeing off a buffer
- Transitions to NULL to terminate the processing
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) VirtualJarFileInputStream.State
getNextState
(VirtualJarFileInputStream jarFileInputStream) (package private) void
init
(VirtualJarFileInputStream jarFileInputStream) (package private) int
read
(VirtualJarFileInputStream jarFileInputStream) (package private) abstract VirtualJarFileInputStream.State
transition
(VirtualJarFileInputStream virtualJarFileInputStream) Returns the enum constant of this type with the specified name.static VirtualJarFileInputStream.State[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
NOT_STARTED
-
LOCAL_ENTRY_HEADER
-
ENTRY_CONTENT
-
START_CENTRAL_DIRECTORY
-
CENTRAL_ENTRY_HEADER
-
CENTRAL_END
-
-
Constructor Details
-
State
private State()
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
init
- Throws:
IOException
-
transition
abstract VirtualJarFileInputStream.State transition(VirtualJarFileInputStream virtualJarFileInputStream) throws IOException - Throws:
IOException
-
read
- Throws:
IOException
-
getNextState
VirtualJarFileInputStream.State getNextState(VirtualJarFileInputStream jarFileInputStream) throws IOException - Throws:
IOException
-