private BlobKey receivePutResponseAndCompare(InputStream is, MessageDigest md) throws IOException { int response = is.read(); if (response < 0) { throw new EOFException("Premature end of response"); } else if (response == RETURN_OKAY) { if (md == null) { // not content addressable return null; } BlobKey remoteKey = BlobKey.readFromInputStream(is); BlobKey localKey = new BlobKey(md.digest()); if (!localKey.equals(remoteKey)) { throw new IOException("Detected data corruption during transfer"); } return localKey; } else if (response == RETURN_ERROR) { Throwable cause = readExceptionFromStream(is); throw new IOException("Server side error: " + cause.getMessage(), cause); } else { throw new IOException("Unrecognized response: " + response + '.'); } }
BlobKey remoteKey = BlobKey.readFromInputStream(is); byte[] localHash = md.digest();
BlobKey remoteKey = BlobKey.readFromInputStream(is); byte[] localHash = md.digest();
BlobKey remoteKey = BlobKey.readFromInputStream(is); byte[] localHash = md.digest();
throw new IOException("Unknown type of BLOB addressing: " + mode + '.'); blobKey = BlobKey.readFromInputStream(inputStream);
throw new IOException("Unknown type of BLOB addressing: " + mode + '.'); blobKey = BlobKey.readFromInputStream(inputStream);
throw new IOException("Unknown type of BLOB addressing: " + mode + '.'); blobKey = BlobKey.readFromInputStream(inputStream);
blobKey = BlobKey.readFromInputStream(inputStream); blobFile = blobServer.getStorageLocation(blobKey);
BlobKey key = BlobKey.readFromInputStream(inputStream); File blobFile = blobServer.getStorageLocation(key);