/** * Constructs and writes the header data for a PUT request to the given output stream. * * @param outputStream * the output stream to write the PUT header data to * @param jobId * the ID of job the BLOB belongs to (or <tt>null</tt> if job-unrelated) * @param blobType * whether the BLOB should become permanent or transient * * @throws IOException * thrown if an I/O error occurs while writing the header data to the output stream */ private static void sendPutHeader( OutputStream outputStream, @Nullable JobID jobId, BlobKey.BlobType blobType) throws IOException { // Signal type of operation outputStream.write(PUT_OPERATION); if (jobId == null) { outputStream.write(JOB_UNRELATED_CONTENT); } else { outputStream.write(JOB_RELATED_CONTENT); outputStream.write(jobId.getBytes()); } outputStream.write(blobType.ordinal()); }
/** * Auxiliary method to write this BLOB key to an output stream. * * @param outputStream * the output stream to write the BLOB key to * @throws IOException * thrown if an I/O error occurs while writing the BLOB key */ void writeToOutputStream(final OutputStream outputStream) throws IOException { outputStream.write(this.key); outputStream.write(this.type.ordinal()); outputStream.write(this.random.getBytes()); } }
/** * Auxiliary method to write this BLOB key to an output stream. * * @param outputStream * the output stream to write the BLOB key to * @throws IOException * thrown if an I/O error occurs while writing the BLOB key */ void writeToOutputStream(final OutputStream outputStream) throws IOException { outputStream.write(this.key); outputStream.write(this.type.ordinal()); outputStream.write(this.random.getBytes()); } }
/** * Constructs and writes the header data for a PUT request to the given output stream. * * @param outputStream * the output stream to write the PUT header data to * @param jobId * the ID of job the BLOB belongs to (or <tt>null</tt> if job-unrelated) * @param blobType * whether the BLOB should become permanent or transient * * @throws IOException * thrown if an I/O error occurs while writing the header data to the output stream */ private static void sendPutHeader( OutputStream outputStream, @Nullable JobID jobId, BlobKey.BlobType blobType) throws IOException { // Signal type of operation outputStream.write(PUT_OPERATION); if (jobId == null) { outputStream.write(JOB_UNRELATED_CONTENT); } else { outputStream.write(JOB_RELATED_CONTENT); outputStream.write(jobId.getBytes()); } outputStream.write(blobType.ordinal()); }
/** * Constructs and writes the header data for a PUT request to the given output stream. * * @param outputStream * the output stream to write the PUT header data to * @param jobId * the ID of job the BLOB belongs to (or <tt>null</tt> if job-unrelated) * @param blobType * whether the BLOB should become permanent or transient * * @throws IOException * thrown if an I/O error occurs while writing the header data to the output stream */ private static void sendPutHeader( OutputStream outputStream, @Nullable JobID jobId, BlobKey.BlobType blobType) throws IOException { // Signal type of operation outputStream.write(PUT_OPERATION); if (jobId == null) { outputStream.write(JOB_UNRELATED_CONTENT); } else { outputStream.write(JOB_RELATED_CONTENT); outputStream.write(jobId.getBytes()); } outputStream.write(blobType.ordinal()); }
/** * Auxiliary method to write this BLOB key to an output stream. * * @param outputStream * the output stream to write the BLOB key to * @throws IOException * thrown if an I/O error occurs while writing the BLOB key */ void writeToOutputStream(final OutputStream outputStream) throws IOException { outputStream.write(this.key); outputStream.write(this.type.ordinal()); outputStream.write(this.random.getBytes()); } }