Here you can find the source of getFileSize(InputStream inputStream)
public static final int getFileSize(InputStream inputStream)
//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; } }