Code example for FileNotFoundException

0
  public InputStream makeInputStream(String filename) throws IOException
  { 
    ByteArrayOutputStream outStream = outStreams.get(filename);
 
    if (outStream == null) {
      throw new FileNotFoundException(String.format("unknown file[%s]", filename));
    } 
 
    return new ByteArrayInputStream(outStream.toByteArray());
  } 
 
  @Override 
  public void cleanup() throws IOException 
  { 
    outStreams.clear();
  } 
}