Package java.io

Examples of java.io.FileInputStream.available()


     */
    public String readHTMLFile(String fileLoc) {
        String errorPage = null;
        try {
            FileInputStream fis = new FileInputStream(fileLoc);
            int x = fis.available();
            byte b[] = new byte[x];
            fis.read(b);
            errorPage = new String(b);
            //close buffers
            fis.close();
View Full Code Here


                return;
            }
            FileInputStream is = new FileInputStream(f);
            byte[] b = new byte[1024];
            int q = 0;
            while((q = is.available()) > 0) {
                if(q > 1024) q = 1024;
                q = is.read(b, 0, q);
                jos.write(b, 0, q);
            }
            is.close();
View Full Code Here

   
    try
    {
      String configFile = getClass().getResource("listenerFile.xml").getFile();
      FileInputStream input = new FileInputStream(configFile);
      byte[] data = new byte[input.available()];
     
      input.read(data);

      ParamRepositoryFactory.getInstance().add("test", new String(data));
                       
View Full Code Here

        String copyofhardtokensn = data.getProperty("COPYOFHARDTOKENSN");
        String hardtokensn = data.getProperty("HARDTOKENSN");
        int validity = Integer.parseInt(data.getProperty("VALIDITY"));   
        String hardtokensnprefix = data.getProperty("HARDTOKENSNPREFIX");
        FileInputStream fis = new FileInputStream(templatefilename);
        byte[] byteData = new byte[fis.available()];
          fis.read(byteData);
          String sVGData = new String(byteData,"UTF8");
          PrinterManager.print(printername, templatefilename, sVGData, 1, validity, userdata, pins, puks, hardtokensnprefix, hardtokensn, copyofhardtokensn)
      } catch(Exception e) {
        getLogger().error(e.getMessage());
View Full Code Here

  private String getRequestData(String regestDataPath) {
    String retval=null;
    try {
      FileInputStream fis = new FileInputStream(regestDataPath);
      byte[] contents = new byte[fis.available()];
      fis.read(contents);     
      fis.close();
      retval = new String(contents);
    } catch (FileNotFoundException e) {
      getPrintStream().println("Error : request data file couln't be found.");
View Full Code Here

 
  private String getPKCS10(String pkcs10Path) {
    String retval=null;
    try {
      FileInputStream fis = new FileInputStream(pkcs10Path);
      byte[] contents = new byte[fis.available()];
      fis.read(contents);     
      fis.close();
      retval = new String(contents);
    } catch (FileNotFoundException e) {
      getPrintStream().println("Error : PKCS10 file couln't be found.");
View Full Code Here

  private String getPKCS10(String pkcs10Path) {
    String retval=null;
    try {
      FileInputStream fis = new FileInputStream(pkcs10Path);
      byte[] contents = new byte[fis.available()];
      fis.read(contents);     
      fis.close();
      retval = new String(contents);
    } catch (FileNotFoundException e) {
      getPrintStream().println("Error : PKCS10 file couln't be found.");
View Full Code Here

          + " filename=\"" + exsistingFileName + "\"" + lineEnd);
      dos.writeBytes(lineEnd);

      // create a buffer of maximum size

      bytesAvailable = fileInputStream.available();
      bufferSize = Math.min(bytesAvailable, maxBufferSize);
      buffer = new byte[bufferSize];

      // read file and write it into form...
View Full Code Here

      bytesRead = fileInputStream.read(buffer, 0, bufferSize);

      while (bytesRead > 0) {
        dos.write(buffer, 0, bufferSize);
        bytesAvailable = fileInputStream.available();
        bufferSize = Math.min(bytesAvailable, maxBufferSize);
        bytesRead = fileInputStream.read(buffer, 0, bufferSize);
      }

      // send multipart form data necesssary after file data...
View Full Code Here

          + " filename=\"" + exsistingFileName + "\"" + lineEnd);
      dos.writeBytes(lineEnd);

      // create a buffer of maximum size

      bytesAvailable = fileInputStream.available();
      bufferSize = Math.min(bytesAvailable, maxBufferSize);
      buffer = new byte[bufferSize];

      // read file and write it into form...
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.