
com.venky.cache.ChannelInputStream Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of common Show documentation
Show all versions of common Show documentation
Commonly used programming tasks in java
The newest version!
package com.venky.cache;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.RandomAccessFile;
public class ChannelInputStream extends InputStream {
Store store = null;
public ChannelInputStream(Store store) {
this.store = store;
}
@Override
public int read() throws IOException {
return store.read();
}
@Override
public int read(byte b[], int off, int len) throws IOException {
return store.read(b,off,len);
}
@Override
public int available() throws IOException {
long available = store.size() - store.position();
return (int)(available > 0 ? available : 0);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy