Ignore:
Timestamp:
2017-10-30T22:46:09+01:00 (7 years ago)
Author:
Don-vip
Message:

fix #15505 - update to metadata-extractor 2.10.1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/com/drew/lang/SequentialByteArrayReader.java

    r10862 r13061  
    11/*
    2  * Copyright 2002-2016 Drew Noakes
     2 * Copyright 2002-2017 Drew Noakes
    33 *
    44 *    Licensed under the Apache License, Version 2.0 (the "License");
     
    3737    private int _index;
    3838
     39    @Override
     40    public long getPosition()
     41    {
     42        return _index;
     43    }
     44
    3945    public SequentialByteArrayReader(@NotNull byte[] bytes)
    4046    {
     
    4248    }
    4349
     50    @SuppressWarnings("ConstantConditions")
    4451    public SequentialByteArrayReader(@NotNull byte[] bytes, int baseIndex)
    4552    {
     
    5259
    5360    @Override
    54     protected byte getByte() throws IOException
     61    public byte getByte() throws IOException
    5562    {
    5663        if (_index >= _bytes.length) {
     
    7380
    7481        return bytes;
     82    }
     83
     84    @Override
     85    public void getBytes(@NotNull byte[] buffer, int offset, int count) throws IOException
     86    {
     87        if (_index + count > _bytes.length) {
     88            throw new EOFException("End of data reached.");
     89        }
     90
     91        System.arraycopy(_bytes, _index, buffer, offset, count);
     92        _index += count;
    7593    }
    7694
     
    105123        return true;
    106124    }
     125
     126    @Override
     127    public int available() {
     128        return _bytes.length - _index;
     129    }
    107130}
Note: See TracChangeset for help on using the changeset viewer.