Source:
int readRemote(long position, byte[] b, int offset, int length) throws IOException { if (position < 0) { throw new IllegalArgumentException("attempting to read from negative offset"); } if (position >= contentLength) { return -1; } if (b == null) { throw new IllegalArgumentException("null byte array passed in to read() method"); } if (offset >= b.length) { throw new IllegalArgumentException("offset greater than length of array"); } if (length < 0) { throw new IllegalArgumentException("requested read length is less than zero"); } if (length > (b.length - offset)) { throw new IllegalArgumentException("requested read length is more than will fit after requested offset in buffer"); } final AbfsRestOperation op; AbfsPerfTracker tracker = client.getAbfsPerfTracker(); try (AbfsPerfInfo perfInfo = new AbfsPerfInfo(tracker, "readRemote", "read")) { LOG.trace(String.format("Trigger client.read for path=%s position=%s offset=%s length=%s", path, position, offset, length)); op = client.read(path, position, b, offset, length, tolerateOobAppends ? "*" : eTag); perfInfo.registerResult(op.getResult()).registerSuccess(true); } catch (AzureBlobFileSystemException ex) { if (ex instanceof AbfsRestOperationException) { AbfsRestOperationException ere = (AbfsRestOperationException) ex; if (ere.getStatusCode() == HttpURLConnection.HTTP_NOT_FOUND) { throw new FileNotFoundException(ere.getMessage()); } } throw new IOException(ex); } long bytesRead = op.getResult().getBytesReceived(); if (bytesRead > Integer.MAX_VALUE) { throw new IOException("Unexpected Content-Length"); } return (int) bytesRead; }

Target:
int readRemote(long position, byte[] b, int offset, int length) throws IOException { if (position < 0) { throw new IllegalArgumentException("attempting to read from negative offset"); } if (position >= contentLength) { return -1; } if (b == null) { throw new IllegalArgumentException("null byte array passed in to read() method"); } if (offset >= b.length) { throw new IllegalArgumentException("offset greater than length of array"); } if (length < 0) { throw new IllegalArgumentException("requested read length is less than zero"); } if (length > (b.length - offset)) { throw new IllegalArgumentException("requested read length is more than will fit after requested offset in buffer"); } final AbfsRestOperation op; AbfsPerfTracker tracker = client.getAbfsPerfTracker(); try (AbfsPerfInfo perfInfo = new AbfsPerfInfo(tracker, "readRemote", "read")) { LOG.trace("Trigger client.read for path={} position={} offset={} length={}", path, position, offset, length); op = client.read(path, position, b, offset, length, tolerateOobAppends ? "*" : eTag, cachedSasToken.get()); cachedSasToken.update(op.getSasToken()); perfInfo.registerResult(op.getResult()).registerSuccess(true); incrementReadOps(); } catch (AzureBlobFileSystemException ex) { if (ex instanceof AbfsRestOperationException) { AbfsRestOperationException ere = (AbfsRestOperationException) ex; if (ere.getStatusCode() == HttpURLConnection.HTTP_NOT_FOUND) { throw new FileNotFoundException(ere.getMessage()); } } throw new IOException(ex); } long bytesRead = op.getResult().getBytesReceived(); if (bytesRead > Integer.MAX_VALUE) { throw new IOException("Unexpected Content-Length"); } return (int) bytesRead; }