Пример #1
0
		/**
		 * Static constructor for class.  Trys to read url into a buffer. If it doesn't fit, 
		 * save it to a file, and return a FileByteReader with that file.
		 */
		public static IByteReader newUrlByteReader(IdentificationFile theIDFile, bool readFile)
		{
			UrlByteReader byteReader = new UrlByteReader(theIDFile, readFile);
			if (byteReader.tempFile == null)
			{
				return byteReader;
			}
			else
			{
				return new FileByteReader(theIDFile, readFile, byteReader.tempFile.FullName); //was getPath()
			}
		}
Пример #2
0
        /**
         * Static constructor for class.  Trys to read url into a buffer. If it doesn't fit,
         * save it to a file, and return a FileByteReader with that file.
         */
        public static IByteReader newUrlByteReader(IdentificationFile theIDFile, bool readFile)
        {
            UrlByteReader byteReader = new UrlByteReader(theIDFile, readFile);

            if (byteReader.tempFile == null)
            {
                return(byteReader);
            }
            else
            {
                return(new FileByteReader(theIDFile, readFile, byteReader.tempFile.FullName));                //was getPath()
            }
        }
 /**
  * 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));
     }
 }