Fountain.getLength() should return a long
authoradam <adam@megacz.com>
Sat, 17 Mar 2007 08:49:13 +0000 (08:49 +0000)
committeradam <adam@megacz.com>
Sat, 17 Mar 2007 08:49:13 +0000 (08:49 +0000)
darcs-hash:20070317084913-5007d-ec6e9d07fc448ca2cae6f2bfe84a0ee806d630bf.gz

src/org/ibex/io/Fountain.java

index 74fb58e..ddf66e4 100644 (file)
@@ -9,34 +9,20 @@ import java.net.*;
 import java.util.*;
 import java.util.zip.*;
 import org.ibex.util.*;
 import java.util.*;
 import java.util.zip.*;
 import org.ibex.util.*;
+import java.sql.*;
 
 /** a source of streams */
 public interface Fountain {
 
     public Stream getStream();
 
 /** a source of streams */
 public interface Fountain {
 
     public Stream getStream();
-    public int getLength();
-    public int getNumLines();
-    /*
-    public static interface Transformer {
-        public Fountain transform(Fountain in);
-
-        public static class Lift implements Fountain.Transformer {
-            private final Stream.Transformer func;
-            public Lift(Stream.Transformer func) { this.func = func; }
-            public Fountain transform(final Fountain in) {
-                return new Fountain() {
-                        public Stream getStream() {
-                            return func.transform(in.getStream()); } };
-            }
-        }
-    }
-    */
+    public long   getLength();
+    public int    getNumLines();
 
     public static class File implements Fountain {
         private final java.io.File file;
         public File(java.io.File file) { this.file = file; }
         public Stream getStream()      { return new Stream(file); }
 
     public static class File implements Fountain {
         private final java.io.File file;
         public File(java.io.File file) { this.file = file; }
         public Stream getStream()      { return new Stream(file); }
-        public int getLength()         { return (int)file.length(); }
+        public long getLength()        { return (int)file.length(); }
         public int getNumLines()       { return Stream.countLines(getStream()); } 
     }
 
         public int getNumLines()       { return Stream.countLines(getStream()); } 
     }
 
@@ -48,7 +34,7 @@ public interface Fountain {
         public ByteArray(byte[] bytes)                   { this(bytes, 0, bytes.length); }
         public ByteArray(byte[] bytes, int off, int len) { this.bytes = bytes; this.off=off; this.len=len; }
         public Stream getStream()                        { return new Stream(bytes, off, len); }
         public ByteArray(byte[] bytes)                   { this(bytes, 0, bytes.length); }
         public ByteArray(byte[] bytes, int off, int len) { this.bytes = bytes; this.off=off; this.len=len; }
         public Stream getStream()                        { return new Stream(bytes, off, len); }
-        public int getLength()                           { return len; }
+        public long getLength()                          { return len; }
         public int getNumLines()                         { return Stream.countLines(getStream()); } 
     }
 
         public int getNumLines()                         { return Stream.countLines(getStream()); } 
     }