code: public static byte[] loadBytesSafely(long offset, int length,
  			RandomAccessFile raf) throws IOException {
  		Preconditions.checkArgument(length >= 0);
  		if (offset < 0)
  			return new byte[0];
  		raf.seek(offset);
  		int readsize = length;
  		if (readsize + offset > raf.length()) {
  			readsize = (int) (raf.length() - offset);
  		}
  		if (readsize < 0) {
  			readsize = 0;
  		}
  		byte[] bytes = new byte[readsize];
  		raf.readFully(bytes);
  		bytes = padBytes(bytes, length);
  		assert bytes.length == length;
  		return bytes;
  	}
docs: Loads the bytes at the offset into a byte array with the given length
  using the raf. If EOF, the byte array is zero padded. If offset < 0 it
  will return a zero sized array.
  
  @param offset
  to seek
  @param length
  of the byte array, equals number of bytes read
  @param raf
  the random access file
  @return byte array
  @throws IOException
  if unable to read the bytes