code: private void addLibraryInternal(final JobID jobID, final Path name, final long size, final DataInput in)
  			throws IOException {
  
  		if (size > (long) Integer.MAX_VALUE) {
  			throw new IOException("Submitted jar file " + name + " is too large");
  		}
  
  		// Map the entire jar file to memory
  		final byte[] buf = new byte[(int) size];
  		in.readFully(buf);
  
  		// Reset and calculate message digest from jar file
  		this.md.reset();
  		this.md.update(buf);
  
  		// Construct internal jar name from digest
  		final String cacheName = StringUtils.byteToHexString(md.digest()) + ".jar";
  		final Path storePath = new Path(this.libraryCachePath + "/" + cacheName);
  
  		synchronized (this.fs) {
  
  			// Check if file already exists in our library cache, if not write it to the cache directory
  			if (!this.fs.exists(storePath)) {
  				final FSDataOutputStream fos = this.fs.create(storePath, false);
  				fos.write(buf, 0, buf.length);
  				fos.close();
  			}
  		}
  
  		// Create mapping for client path and cache name
  		final LibraryTranslationKey key = new LibraryTranslationKey(jobID, name);
  		this.clientPathToCacheName.putIfAbsent(key, cacheName);
  	}
docs: Reads a library from the given input stream and adds it to the local library cache. The cache name of
  the library is determined by the checksum of the received data and cannot be specified manually.
  
  @param jobID
  the ID of the job the library data belongs to
  @param name
  the name of the library at the clients host
  @param size
  the size of the library to be read from the input stream
  @param in
  the data input stream
  @throws IOException
  thrown if an error occurred while reading the library data from the input stream