code: private void writeLibraryToStreamInternal(final String libraryFileName, final DataOutput out) throws IOException {
  
  		if (libraryFileName == null) {
  			throw new IOException("libraryName is null!");
  		}
  
  		final Path storePath = new Path(this.libraryCachePath + "/" + libraryFileName);
  
  		synchronized (this.fs) {
  
  			if (!fs.exists(storePath)) {
  				throw new IOException(storePath + " does not exist!");
  			}
  
  			final FileStatus status = fs.getFileStatus(storePath);
  
  			StringRecord.writeString(out, libraryFileName);
  			out.writeLong(status.getLen());
  
  			final FSDataInputStream inStream = fs.open(storePath);
  			final byte[] buf = new byte[8192]; // 8K Buffer*/
  			int read = inStream.read(buf, 0, buf.length);
  			while (read > 0) {
  				out.write(buf, 0, read);
  				read = inStream.read(buf, 0, buf.length);
  			}
  
  			inStream.close();
  		}
  	}
docs: Writes data from the library with the given file name to the specified stream.
  
  @param libraryFileName
  the name of the library
  @param out
  the stream to write the data to
  @throws IOException
  thrown if an error occurs while writing the data