use of org.apache.hadoop.hdds.scm.storage.ByteReaderStrategy in project ozone by apache.
the class KeyInputStream method read.
/**
* {@inheritDoc}
*/
@Override
public synchronized int read(byte[] b, int off, int len) throws IOException {
ByteReaderStrategy strategy = new ByteArrayReader(b, off, len);
int bufferLen = strategy.getTargetLength();
if (bufferLen == 0) {
return 0;
}
return readWithStrategy(strategy);
}
use of org.apache.hadoop.hdds.scm.storage.ByteReaderStrategy in project ozone by apache.
the class KeyInputStream method read.
@Override
public synchronized int read(ByteBuffer byteBuffer) throws IOException {
ByteReaderStrategy strategy = new ByteBufferReader(byteBuffer);
int bufferLen = strategy.getTargetLength();
if (bufferLen == 0) {
return 0;
}
return readWithStrategy(strategy);
}
Aggregations