1 20 package org.apache.derbyTesting.functionTests.util; 21 import java.io.InputStream ; 22 import java.io.IOException ; 23 24 28 public final class TestInputStream extends InputStream 29 { 30 35 public TestInputStream(long length, int value) 36 { 37 this.value = value; 38 this.length = length; 39 this.pos = 0; 40 } 41 42 47 public int read() 48 throws IOException 49 { 50 if (++pos>length) return -1; 51 return value; 52 } 53 54 55 private long pos; 56 57 58 final int value; 59 60 61 final long length; 62 } 63 | Popular Tags |