Java tutorial
//package com.java2s; import java.io.IOException; import java.io.InputStream; public class Main { public static int read(InputStream in, byte[] buffer) { try { return in.read(buffer); } catch (IOException e) { return 0; } } }