コード例 #1
0
		/**
		 * Static constructor for class.  Trys to read stream into a buffer. If it doesn't fit, 
		 * save it to a file, and return a FileByteReader with that file.
		 */
		internal static IByteReader newInputStreamByteReader(IdentificationFile theIDFile, bool readFile) // was ByteReader
		{
			InputStreamByteReader byteReader = new InputStreamByteReader(theIDFile, readFile);
			if (byteReader.tempFile == null)
			{
				return byteReader;
			}
			else
			{
				return new FileByteReader(theIDFile, readFile, byteReader.tempFile.FullName); //getPath());
			}
		}
コード例 #2
0
        /**
         * Static constructor for class.  Trys to read stream into a buffer. If it doesn't fit,
         * save it to a file, and return a FileByteReader with that file.
         */
        internal static IByteReader newInputStreamByteReader(IdentificationFile theIDFile, bool readFile)         // was ByteReader
        {
            InputStreamByteReader byteReader = new InputStreamByteReader(theIDFile, readFile);

            if (byteReader.tempFile == null)
            {
                return(byteReader);
            }
            else
            {
                return(new FileByteReader(theIDFile, readFile, byteReader.tempFile.FullName));                //getPath());
            }
        }
コード例 #3
0
 /**
  * Static constructor for a ByteReader object, and depending on the readFile setting,
  * it may or may not read in the binary file specified.
  *
  * This may create a FileByteReader, UrlByteReader or InputStreamByteReader, depending on the
  * the nature of the IdentificationFile passed in.
  *
  *
  * @param theIDFile   The file to be read in
  * @param readFile   Flag specifying whether file should be read in or not
  */
 public static IByteReader newByteReader(IdentificationFile theIDFile, bool readFile)         //was ByteReader
 {
     if (InputStreamByteReader.isInputStream(theIDFile.getFilePath()))
     {
         return(InputStreamByteReader.newInputStreamByteReader(theIDFile, readFile));
     }
     else if (UrlByteReader.isURL(theIDFile.getFilePath()))
     {
         return(UrlByteReader.newUrlByteReader(theIDFile, readFile));
     }
     else
     {
         return(new FileByteReader(theIDFile, readFile));
     }
 }