public long getBytesTransferred() {
        switch(eventType) {
            case REQUEST_BYTE_TRANSFER_EVENT:
            case RESPONSE_BYTE_TRANSFER_EVENT:
                return bytes;
            case HTTP_RESPONSE_CONTENT_RESET_EVENT:
            case HTTP_REQUEST_CONTENT_RESET_EVENT:
            case RESPONSE_BYTE_DISCARD_EVENT:
                return 0 - bytes;
        default:
            return 0;
        }
    }
Convenient method to returns the number of bytes transferred in this
event, or the number of bytes reset (or discarded) if negative. In
particular, bytes of a content-length event is excluded.
aws-java-sdk-core/src/main/java/com/amazonaws/event/ProgressEvent.java