1 /** 2 * Authors: Frank Benoit <keinfarbton@googlemail.com> 3 */ 4 5 module java.io.InputStream; 6 7 import java.lang.all; 8 9 public abstract class InputStream { 10 11 12 public this (){ 13 } 14 15 public abstract int read(); 16 17 public int read( byte[] b ){ 18 foreach( uint idx, ref byte val; b ){ 19 int c = read(); 20 if( c == -1 ){ 21 return ( idx == 0 ) ? -1 : idx; 22 } 23 b[ idx] = cast(byte)( c & 0xFF ); 24 } 25 return cast(int)/*64bit*/b.length; 26 } 27 28 public ptrdiff_t read( byte[] b, ptrdiff_t off, ptrdiff_t len ){ 29 return read( b[ off .. off+len ] ); 30 } 31 32 public long skip( long n ){ 33 implMissing( __FILE__, __LINE__ ); 34 return 0L; 35 } 36 37 public ptrdiff_t available(){ 38 return 0; 39 } 40 41 public void close(){ 42 implMissing( __FILE__, __LINE__ ); 43 } 44 45 public synchronized void mark( int readlimit ){ 46 implMissing( __FILE__, __LINE__ ); 47 } 48 49 public synchronized void reset(){ 50 implMissing( __FILE__, __LINE__ ); 51 } 52 53 public bool markSupported(){ 54 implMissing( __FILE__, __LINE__ ); 55 return false; 56 } 57 58 59 } 60 61