Package com.j3d.storage.files.protocol
Class GenericFileProtocol
java.lang.Object
com.j3d.storage.files.protocol.GenericFileProtocol
- Direct Known Subclasses:
ProjectFile
GenericFileProtocol provides methods to read and write
a standard file header for J3D files.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final StringThe Header for all J3D files.private static final intThe version of J3D itself that created the file. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidReads and validates the standard J3D file header from the provided DataInputStream.voidWrites the standard J3D file header to the provided DataOutputStream.
-
Field Details
-
HEADER_TOP
The Header for all J3D files.- See Also:
-
VERSION
private static final int VERSIONThe version of J3D itself that created the file.- See Also:
-
-
Constructor Details
-
GenericFileProtocol
public GenericFileProtocol()
-
-
Method Details
-
writeHeader
Writes the standard J3D file header to the provided DataOutputStream.- Parameters:
dos- The DataOutputStream to write the header to.- Throws:
IOException- If an I/O error occurs.
-
readHeader
Reads and validates the standard J3D file header from the provided DataInputStream.- Parameters:
dis- The DataInputStream to read the header from.- Throws:
IOException- If an I/O error occurs or if the header is invalid.
-