Get the raw bytes and the last modification millis for this JobFile

@return the contents of the job file.
@throws IOException when bad things happen during reading
6849
private byte[] readJobFile(FileStatus fileStatus) throws IOException {
    byte[] rawBytes = null;
    FSDataInputStream fsdis = null;
    try {
      long fileLength = fileStatus.getLen();
      int fileLengthInt = (int) fileLength;
      rawBytes = new byte[fileLengthInt];
      fsdis = hdfs.open(fileStatus.getPath());
      IOUtils.readFully(fsdis, rawBytes, 0, fileLengthInt);
    } finally {
      IOUtils.closeStream(fsdis);
    }
    return rawBytes;
  }
1028740
public InputSplit[] getSplits(JobConf job, int numSplits)
  throws IOException {
    ArrayList<FileSplit> splits = new ArrayList<FileSplit>();
    for (FileStatus status : listLocatedStatus(job)) {
      Path fileName = status.getPath();
      if (status.isDir()) {
        throw new IOException("Not a file: " + fileName);
      }
      FileSystem  fs = fileName.getFileSystem(job);
      LineReader lr = null;
      try {
        FSDataInputStream in  = fs.open(fileName);
        lr = new LineReader(in, job);
        Text line = new Text();
        int numLines = 0;
        long begin = 0;
        long length = 0;
        int num = -1;
        while ((num = lr.readLine(line)) > 0) {
          numLines++;
          length += num;
          if (numLines == N) {
            splits.add(new FileSplit(fileName, begin, length, new String[]{}));
            begin += length;
            length = 0;
            numLines = 0;
          }
        }
        if (numLines != 0) {
          splits.add(new FileSplit(fileName, begin, length, new String[]{}));
        }
   
      } finally {
        if (lr != null) {
          lr.close();
        }
      }
    }
    return splits.toArray(new FileSplit[splits.size()]);
  }
868731
public byte[] getBytes() {
		byte[] bytes = new byte[SIZE];
		longToByteArray(lowerPart, bytes, 0);
		longToByteArray(upperPart, bytes, SIZE_OF_LONG);
		return bytes;
	}
712853
public SF readStructuredField() throws IOException {
		
		int buf = 0;
		
		long thisOffset = offset;

		if(leadingLengthBytes == -1) {
			// we haven't tested for mvs download leading length bytes
			// we don't need them and don't want to see them
			int leadingLength = 0;
			do {
				buf = read(); offset++;
				leadingLength++;
			} while((buf & 0xff) != 0x5a && buf != -1 && leadingLength < 5);
			
			if((buf & 0xff) != 0x5a) {
			    has5a = false;
			    leadingLength = 1;
			    // so try if byte 3 is 0xd3 -> so this would be an afp without 5a magic byte
			    offset = 2;
			    buf = read();
			    if(buf == -1) return null;
			    if((buf & 0xff) != 0xd3) {
		            throw new IOException("cannot find 5a magic byte nor d3 -> this is no AFP");			        
			    }
			    offset = 0;
			}
			
			leadingLengthBytes = leadingLength-1;
			
//			if(buf == -1 && leadingLength > 1)
//				throw new IOException("found trailing garbage at the end of file.");
		} else {
			if(leadingLengthBytes > 0) read(data, 0, leadingLengthBytes); // just throw away those
			if(has5a) {
			    buf = read();
			    offset++;
			}
		}
		
		if(buf == -1) {
			return null;
		}
		
		if(has5a && (buf & 0xff) != 0x5a) {
			throw new IOException("cannot find 5a magic byte");
		}
		data[0] = 0x5a; // (byte) (buf & 0xff);
		
		buf = read(); offset++;
		if(buf == -1 && !has5a) {
		    return null; 
		}
		
		if(buf == -1) {
			throw new IOException("premature end of file.");
		}
		data[1] = (byte) (buf & 0xff);

		length = (byte) buf << 8;

		buf = read(); offset++;
		if(buf == -1)
			throw new IOException("premature end of file.");
		data[2] = (byte) (buf & 0xff);

		length |= (byte) buf & 0xff;
		
		length -= 2;
		
		if(length > data.length)
			throw new IOException("length of structured field is too large: "+length);
				
		int read = read(data, 3, length);
		offset += read;
		
		if(read < length)
			throw new IOException("premature end of file.");
		
		SF sf = factory.sf(data, 0, getLength() + 2);
		sf.setLength(length + 3);
		sf.setOffset(thisOffset);
		sf.setNumber(number++);
		
		return sf;
	}
966373
public FsSettings readAsJson(String jobname) throws IOException {
        return FsSettingsParser.fromJson(readFile(jobname, FILENAME_JSON));
    }
952440
public byte[] getContentAsByteArray() {
        if (content == null) {
            try {
                content = IOHelper.byteArrayFromStream(is);
            } catch (IOException e) {
                throw new RuntimeException("IOException buffering binary data",
                        e);
            }
            is = null;
        }
        return content;
    }
159771
public JobProfile readJobProfile(JobID jobId) {
    JobProfile jobProfile = null;
    if (active) {
      try {
        FSDataInputStream dataIn = getJobInfoFile(jobId);
        if (dataIn != null) {
          readJobStatus(dataIn);
          jobProfile = readJobProfile(dataIn);
          dataIn.close();
        }
      } catch (IOException ex) {
        LOG.warn("Could not read [" + jobId + "] job profile : " + ex, ex);
      }
    }
    return jobProfile;
  }
252665
@Override public List<InputSplit> getSplits(JobContext job)
		throws IOException
	{
		if (this.conf == null)
			this.conf = job.getConfiguration();

		final List<InputSplit> origSplits =
				BAMInputFormat.removeIndexFiles(super.getSplits(job));

		// We have to partition the splits by input format and hand them over to
		// the *InputFormats for any further handling.
		//
		// BAMInputFormat and CRAMInputFormat need to change the split boundaries, so we can
		// just extract the BAM and CRAM ones and leave the rest as they are.

		final List<InputSplit>
			bamOrigSplits = new ArrayList<InputSplit>(origSplits.size()),
			cramOrigSplits = new ArrayList<InputSplit>(origSplits.size()),
			newSplits     = new ArrayList<InputSplit>(origSplits.size());

		for (final InputSplit iSplit : origSplits) {
			final FileSplit split = (FileSplit)iSplit;

			if (SAMFormat.BAM.equals(getFormat(split.getPath())))
				bamOrigSplits.add(split);
			else if (SAMFormat.CRAM.equals(getFormat(split.getPath())))
				cramOrigSplits.add(split);
			else
				newSplits.add(split);
		}
		newSplits.addAll(bamIF.getSplits(bamOrigSplits, job.getConfiguration()));
		newSplits.addAll(cramIF.getSplits(cramOrigSplits, job.getConfiguration()));
		return newSplits;
	}
423938
public BufferedInputStream getInputStream() throws IORuntimeException {
		try {
			return new BufferedInputStream(new FileInputStream(this.file));
		} catch (IOException e) {
			throw new IORuntimeException(e);
		}
	}
104256
public byte[] getBytesF() {
		final int len = getInt();
		final byte[] bytes = new byte[len];
		System.arraycopy(buf, bufPosition, bytes, 0, bytes.length);
		bufPosition += bytes.length;
		return bytes;
	}
767438
public Map<String, Job> getJobs(FolderJob folder) throws IOException {
        return getJobs(folder, null);
    }
1170775
public byte[] getBytes() {
		final int len = getVInt();
		final byte[] bytes = new byte[len];
		System.arraycopy(buf, bufPosition, bytes, 0, bytes.length);
		bufPosition += bytes.length;
		return bytes;
	}
1286651
public long getModificationTime() {
    if (attributes.containsKey(FILE_MODIFICATION_TIMESTAMP_KEY)
        && attributes.get(FILE_MODIFICATION_TIMESTAMP_KEY) != null) {
      try {
        return Longs.fromByteArray(attributes.get(FILE_MODIFICATION_TIMESTAMP_KEY));
      } catch (IllegalArgumentException iae) {
        logger.atFine().log(
            "Failed to parse modification time '%s' millis for object %s",
            attributes.get(FILE_MODIFICATION_TIMESTAMP_KEY), itemInfo.getObjectName());
      }
    }
    return getCreationTime();
  }
78906
public static byte[] getFileContents(File file) throws IOException {
    FileInputStream stream = new FileInputStream(file);
    byte[] contents = new byte[(int) file.length()];
    stream.read(contents);
    stream.close();
    return contents;
  }
677888
public byte[] getBytes()
	{
		byte b[] = new byte[getLength()];
		int bytesCopied = 0;

		Iterator<V> it = this.values().iterator();
		while (it.hasNext())
		{
			ID3v2Frame frame = (ID3v2Frame) it.next();
			System.arraycopy(frame.getFrameBytes(), 0, b, bytesCopied, frame.getFrameLength());
			bytesCopied += frame.getFrameLength();
		}

		return b;
	}
1234089
public byte readByte () throws IOException
  {
    // Buffer depleted ?
    if (m_nHead == m_nTail)
    {
      m_nHead = 0;
      // Refill.
      m_nTail = m_aIS.read (m_aBuffer, m_nHead, m_nBufSize);
      if (m_nTail == -1)
      {
        // No more data available.
        throw new IOException ("No more data is available");
      }
      if (m_aNotifier != null)
      {
        m_aNotifier.noteBytesRead (m_nTail);
      }
    }
    return m_aBuffer[m_nHead++];
  }
822072
public InputStream getContents() {
        final byte[] copy;
        synchronized (this) {
            final int length = this.contents.length;
            copy = new byte[length];
            System.arraycopy(this.contents, 0, copy, 0, this.contents.length);
        }
        return new ByteArrayInputStream(copy);
    }