Package org.web3d.vrml.parser
Class VRMLParserUtils
java.lang.Object
org.web3d.vrml.parser.VRMLParserUtils
General convenience utilities for handling parsing of VRML files.
- Version:
- $Revision: 1.3 $
- Author:
- Justin Couch
-
Method Summary
Modifier and TypeMethodDescriptionstatic String[]
parseFileHeader
(InputStream stream) Take the stream and strip the first line out of it to check that it is a vrml file.static String[]
parseFileHeader
(Reader stream) Take the reader and strip the first line out of it to check that it is a vrml file.
-
Method Details
-
parseFileHeader
Take the stream and strip the first line out of it to check that it is a vrml file. If it is, return an array of the contents of the first line. The array is arranged as:
ret_val[0] = "#VRML" or "#X3D"
ret_val[1] = version string ("V2.0", "V3.0" etc)
ret_val[2] = encoding type ("utf8" usually)
ret_val[3] = The rest of the line - a commentIf the first two characters are not "#V" then this will terminate and not read the characters any further. The first two characters will be returned as a string in the first item and only in the array. The items in the array are built based on whitespace separators. That is, we don't explicitly look for these strings, but rather just give the next whitespace separated token. If we run out of tokens then any remaining items in the array are set to null.
- Parameters:
stream
- The input stream to source characters from.- Returns:
- An array of the items of the header
- Throws:
IOException
- Something happened while reading the stream
-
parseFileHeader
Take the reader and strip the first line out of it to check that it is a vrml file. If it is, return an array of the contents of the first line. The output and assumptions are the same as the version of this method that takes an InputStream.- Parameters:
stream
- The input stream to source characters from.- Returns:
- An array of the items of the header
- Throws:
IOException
- Something happened while reading the stream- See Also:
-