Java File Size Get getFileSize(InputStream inputStream)

Here you can find the source of getFileSize(InputStream inputStream)

Description

get File Size

License

Open Source License

Declaration

public static final int getFileSize(InputStream inputStream) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.IOException;
import java.io.InputStream;

public class Main {

    public static final int getFileSize(InputStream inputStream) {

        int size = 0;

        try {/*  ww  w . j  a  v a  2s . co m*/
            size = inputStream.available();
        } catch (IOException e) {
            e.printStackTrace();
        }

        return size;
    }
}

Related

  1. getFileSize(File file)
  2. getFileSize(File[] files)
  3. getFileSize(final String filename)
  4. getFileSize(final String filePath)
  5. getFileSize(final String path)
  6. getFileSize(int fileSize)
  7. getFileSize(long fileSize)
  8. getFilesize(String address)
  9. getFileSize(String fileName)