Package java.io

Examples of java.io.FileInputStream.available()


        FileOutputStream fos=null;
       
        try {
          fis=new FileInputStream(f);
         
          byte[] b=new byte[fis.available()];
          fis.read(b);
         
          String str=new String(b);
         
          fis.close();
View Full Code Here


    byte[] returnByteArray = null;

    FileInputStream fileInputStream = new FileInputStream(licenseFile);
    DataInputStream dataInputStream = new DataInputStream(fileInputStream);
    try {
      returnByteArray = new byte[fileInputStream.available()];
      dataInputStream.readFully(returnByteArray);
    } finally {
      dataInputStream.close();
      fileInputStream.close();
    }
View Full Code Here

          // Catch the IOException on this FileInputStream constructor and
          // on the read method so we can collect the buffer.

          fileInputStream = new FileInputStream(imageFile);
          buffer = new byte[fileInputStream.available()];
          if (buffer != null) {
            for (int i = 0, n = fileInputStream.available(); i < n; i++) {
              buffer[i] = (byte)fileInputStream.read();
            }
          }
View Full Code Here

          // on the read method so we can collect the buffer.

          fileInputStream = new FileInputStream(imageFile);
          buffer = new byte[fileInputStream.available()];
          if (buffer != null) {
            for (int i = 0, n = fileInputStream.available(); i < n; i++) {
              buffer[i] = (byte)fileInputStream.read();
            }
          }
        } catch (CvFileException e) {
          logger.error("[CVFileEJB] Exception thrown in getFileInputStream.", e);
View Full Code Here

        byte[] contents = null;
        File f = new File(filename);
        try {
            FileInputStream fis = new FileInputStream(f);
            int nAvail = fis.available();
            contents = new byte[nAvail];
            /*int length = */fis.read(contents);
            fis.close();

            new IOR(contents).parse(new PrintWriter(System.out, true));
View Full Code Here

   protected static byte[] readFromFile (String filename)
      throws FileNotFoundException, IOException
   {
      FileInputStream fileInputStream = new FileInputStream(filename);
      int fileSize = fileInputStream.available();
      byte[] b = new byte[fileSize];
      fileInputStream.read(b);
      return b;
   }
View Full Code Here

     */
    public static byte[] readFromFile(String fileName) throws Exception {
        byte[] info;
        try {
            FileInputStream fis = new FileInputStream(fileName);
            info = new byte[fis.available()];
            fis.read(info);
            fis.close();
        } catch (Exception e) {
            System.err.println("exception " + e.toString());
            info = new byte[0];
View Full Code Here

     */
    public static byte[] readFromFile(String fileName) throws Exception {
        byte[] info;
        try {
            FileInputStream fis = new FileInputStream(fileName);
            info = new byte[fis.available()];
            fis.read(info);
            fis.close();
        } catch (Exception e) {
            info = new byte[0];
            throw new Exception(e);
View Full Code Here

    });
    long time = 0, size = 0;
    for(int i=0; i<n; i++) {
      for(File txt : txts) {
        FileInputStream ftxt = new FileInputStream(txt);
        int s = ftxt.available();
        size += s;
        BufferedReader reader = new BufferedReader(new InputStreamReader(ftxt));
       
        OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream(new File(txt.getAbsoluteFile()+"."+outputChipName+".word")));
        BufferedWriter bw = new BufferedWriter(osw);
View Full Code Here

    });
    long time = 0, size = 0;
    for(int i=0; i<n; i++) {
      for(File txt : txts) {
        FileInputStream ftxt = new FileInputStream(txt);
        int s = ftxt.available();
        size += s;
        TokenStream ts = analyzer.tokenStream("text", new InputStreamReader(ftxt));
        OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream(new File(txt.getAbsoluteFile()+"."+outputChipName+".word")));
        BufferedWriter bw = new BufferedWriter(osw);
        long start = System.currentTimeMillis();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.