title: How to write a custom exception for Input stream that may end prematurely
body: <p>I would like to write a custom exception <strong>(RunTimeException</strong>) for Input stream that may end prematurely instead of catching IOException for the following code:</p>
  
  <pre><code>    public static int deserializeInt(InputStream inputStream) {
      int deserializeObject;
      final int NUMBER_OF_BYTE_OF_INTEGER = 4;
      byte[] databytesArr = new byte[NUMBER_OF_BYTE_OF_INTEGER];
      try {
          inputStream.read(databytesArr, 0, databytesArr.length);
      } catch (IOException e) {
          e.printStackTrace();
      }
      deserializeObject = ByteBuffer.wrap(databytesArr).getInt();
      return deserializeObject;
  }
  </code></pre>
  
  <p>I would like a special class for the custom exception </p>