Read instance.

@param fileReader the file reader
@return true, if successful
763952
public boolean readInstance(Reader fileReader) {

        //ArffReader arff = new ArffReader(reader, this, m_Lines, 1);
        Instance inst = arff.readInstance();
        if (inst != null) {
            inst.setDataset(this);
            add(inst);
            return true;
        } else {
            return false;
        }
    }
984885
private String[] readFile(String fileName) throws IOException {
    ArrayList<String> result = new ArrayList<String>();
    FileReader fReader = new FileReader(fileName);
    BufferedReader bReader = new BufferedReader(fReader);
    while (true) {
      String line = bReader.readLine();
      if (line == null) {
        break;
      }
      result.add(line);
    }
    bReader.close();
    fReader.close();
    return (String[])result.toArray(new String[result.size()]);
  }
746631
public String read() {
    if (mode.isReadable() == false)
      throw new IllegalStateException("IOError: not opened for reading");

    StringBuilder sb = new StringBuilder();
    try {
      BufferedReader reader = new BufferedReader(new FileReader(file));
      char[] buf = new char[1024];
      int numOfChars = 0;
      while ((numOfChars = reader.read(buf)) != -1) {
        sb.append(String.valueOf(buf, 0, numOfChars));
      }
      reader.close();
    } catch (IOException e) {
      logger.log(Level.SEVERE, null, e);
      throw new RuntimeException(e);
    }
    return sb.toString();
  }
58759
public static BufferedReader asBufferedReader(String fileName) throws IOException {
		Validate.notBlank(fileName, "filename is blank");
		return asBufferedReader(getPath(fileName));
	}
259339
@Override
    public InputStream read()
        throws EFapsException
    {
        StoreResourceInputStream in = null;
        try  {
            final FileObject file = this.manager.resolveFile(this.storeFileName + VFSStoreResource.EXTENSION_NORMAL);
            if (!file.isReadable())  {
                VFSStoreResource.LOG.error("file for " + this.storeFileName + " not readable");
                throw new EFapsException(VFSStoreResource.class, "#####file not readable");
            }
            in = new VFSStoreResourceInputStream(this, file);
        } catch (final FileSystemException e)  {
            VFSStoreResource.LOG.error("read of " + this.storeFileName + " failed", e);
            throw new EFapsException(VFSStoreResource.class, "read.Throwable", e);
        } catch (final IOException e) {
            VFSStoreResource.LOG.error("read of " + this.storeFileName + " failed", e);
            throw new EFapsException(VFSStoreResource.class, "read.Throwable", e);
        }
        return in;
    }
47573
public static boolean canReadFile(File file) {		
		if(file!=null && file.canRead() && !file.isDirectory()){
			return true;
		} else {
			return false;
		}		
	}
74107
public static Instance readInstance(Reader r) {
        try {
            InstanceConverter c = new InstanceConverter();
            return c.fromJSON(r);
        } catch (JSONConverterException e) {
            throw new IllegalArgumentException(e);
        }
    }
603448
@Override
    public synchronized File read()
        throws Exception, UnexpectedInputException, ParseException, NonTransientResourceException {

        if (walker == null) {
            this.walker = new SimpleDirectoryWalker(rootDirectory);
            this.walker.start();
            //skip ahead if items have already been processed.
            long itemsRead = getItemsRead();
            if (itemsRead > 0) {
                for (int i = 0; i < itemsRead; i++) {
                    this.walker.next();
                }
            }
        }

        return this.walker.next();
    }
328270
public static void initReadme() {
        try {
            InputStream readmeStream = JavadocFixTool.class.getResourceAsStream("/README");
            if (readmeStream != null) {
                BufferedReader readmeReader = new BufferedReader(new InputStreamReader(readmeStream));
                StringBuilder readmeBuilder = new StringBuilder();
                String s;
                while ((s = readmeReader.readLine()) != null) {
                    readmeBuilder.append(s);
                    readmeBuilder.append("\n");
                }
                readme = readmeBuilder.toString();
            }
        } catch (IOException ignore) {} // Ignore exception - readme not initialized
    }
141061
@Pure
	protected DBaseFileReader getReader() throws IOException {
		if (this.reader == null) {
			this.reader = new DBaseFileReader(this.url.openStream());
			this.reader.readDBFHeader();
			this.reader.readDBFFields();
		}
		return this.reader;
	}
968790
def read(self, filename):
        

        try:
            with open(filename, 'r') as _file:
                self._filename = filename
                self.readstream(_file)
            return True

        except IOError:
            self._filename = None
            return False
1249085
public <T> T read(final Reader reader, final DataTypeDescriptor<T> descriptor) {
		try {
			return jsonFormat.read(reader, descriptor);
		} catch (Exception e) {
			throw propagate(e);
		}
	}
1071242
public boolean read() throws IOException
    {
        valid = false;
        File file = new File(filename);
        FileReader reader = new FileReader(file);
        if(file.exists())
        {
            // Load the file contents
            contents = getContents(reader, "\n");
            if(contents != null)
                valid = true;
            else
                logger.severe("Unable to read file contents: "+file.getAbsolutePath());
        }
        else
        {
            logger.severe("File does not exist: "+file.getAbsolutePath());
        }

        try
        {
            if(reader != null)
                reader.close();
        }
        catch(IOException e)
        {
        }

        return valid;
    }
193188
ImageReader createJPEGReader() {
        maybeInitJPEGProvider();
        if (jpegProvider == null) {
            throw new IllegalStateException("No suitable JPEG reader provider found");
        }

        try {
            return jpegProvider.createReaderInstance();
        }
        catch (IOException e) {
            // NOTE: The default Sun version never throws IOException here
            throw new Error("Could not create JPEG reader: " + e.getMessage(), e);
        }
    }
365639
@SuppressWarnings("nls")
    public static ImageReader findReader() {
        Iterator<ImageReader> readers = ImageIO.getImageReadersByFormatName("jpeg");
        ImageReader reader = null;
        while( readers.hasNext() ) {
            reader = (ImageReader) readers.next();
            if (reader.getClass().getName().startsWith("com.sun.media")) { // com.sun.imageio?
                break;
            }
        }
        return reader;
    }
526930
public static InputStreamReader getInputStreamReader(final File resource, final String encoding) throws IOException {
		return new InputStreamReader(getInputStream(resource), encoding);
	}
206701
protected FileReader createReader(LogFilePath srcPath, CompressionCodec codec) throws Exception {
        return ReflectionUtil.createFileReader(
                mConfig.getFileReaderWriterFactory(),
                srcPath,
                codec,
                mConfig
        );
    }