code: private void readLibraryFromStreamInternal(final DataInput in) throws IOException {
  
  		final String libraryFileName = StringRecord.readString(in);
  
  		if (libraryFileName == null) {
  			throw new IOException("libraryFileName is null!");
  		}
  
  		final long length = in.readLong();
  
  		if (length > (long) Integer.MAX_VALUE) {
  			throw new IOException("Submitted jar file " + libraryFileName + " is too large");
  		}
  
  		final byte[] buf = new byte[(int) length];
  		in.readFully(buf);
  
  		final Path storePath = new Path(this.libraryCachePath + "/" + libraryFileName);
  
  		synchronized (this.fs) {
  
  			// Check if file already exists in our library cache, if not write it to the cache directory
  			if (!fs.exists(storePath)) {
  				final FSDataOutputStream fos = fs.create(storePath, false);
  				fos.write(buf, 0, buf.length);
  				fos.close();
  			}
  		}
  	}
docs: Reads library data from the given stream.
  
  @param in
  the stream to read the library data from
  @throws IOException
  throws if an error occurs while reading from the stream