EntryInputStream.java from Kneobase at Krugle
Show EntryInputStream.java syntax highlighted
/*
* Created on 01/11/2004
*
*/
package com.kneobase.driver.compressed;
import java.io.IOException;
import java.io.InputStream;
/**
* @author Ernesto De Santis
*
*/
public class EntryInputStream extends InputStream {
private InputStream inputStream;
private long entrySize;
private long readed = 0;
public EntryInputStream(InputStream inputStream, long entrySize) {
this.inputStream = inputStream;
this.entrySize = entrySize;
}
/* (non-Javadoc)
* @see java.io.InputStream#read()
*/
public int read() throws IOException {
if(readed < entrySize)
return inputStream.read();
else
return -1;
}
}
See more files for this project here