Changeset 13061 in josm for trunk/src/com/drew/lang/SequentialByteArrayReader.java
- Timestamp:
- 2017-10-30T22:46:09+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/com/drew/lang/SequentialByteArrayReader.java
r10862 r13061 1 1 /* 2 * Copyright 2002-201 6Drew Noakes2 * Copyright 2002-2017 Drew Noakes 3 3 * 4 4 * Licensed under the Apache License, Version 2.0 (the "License"); … … 37 37 private int _index; 38 38 39 @Override 40 public long getPosition() 41 { 42 return _index; 43 } 44 39 45 public SequentialByteArrayReader(@NotNull byte[] bytes) 40 46 { … … 42 48 } 43 49 50 @SuppressWarnings("ConstantConditions") 44 51 public SequentialByteArrayReader(@NotNull byte[] bytes, int baseIndex) 45 52 { … … 52 59 53 60 @Override 54 p rotectedbyte getByte() throws IOException61 public byte getByte() throws IOException 55 62 { 56 63 if (_index >= _bytes.length) { … … 73 80 74 81 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; 75 93 } 76 94 … … 105 123 return true; 106 124 } 125 126 @Override 127 public int available() { 128 return _bytes.length - _index; 129 } 107 130 }
Note:
See TracChangeset
for help on using the changeset viewer.