public int read(byte[] buffer) throws IOException {
            int toRead = buffer.length;
            int read;
            while (toRead > 0 && ((read = is.read(buffer, buffer.length - toRead, toRead)) != -1)) {
                toRead -= read;
            }
            return buffer.length - toRead;
        }
Parse the orientation from the image header. If it doesn't handle this image type (or this is not an image)
it will return a default value rather than throwing an exception.

@return The exif orientation if present or -1 if the header couldn't be parsed or doesn't contain an orientation
@throws IOException
core/src/main/java/com/bumptech/glide/load/resource/bitmap/ImageHeaderParser.java