Mercurial > projects > dwt2
comparison base/src/java/io/InputStream.d @ 27:1bf55a6eb092
Renamed java tree to base
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 21 Mar 2009 11:33:57 +0100 |
parents | java/src/java/io/InputStream.d@6dd524f61e62 |
children | 536e43f63c81 |
comparison
equal
deleted
inserted
replaced
26:f589fc20a5f9 | 27:1bf55a6eb092 |
---|---|
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, inout 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 b.length; | |
26 } | |
27 | |
28 public int read( byte[] b, int off, int 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 int 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 |