Changeset 13512 for trunk/abcl/src/org


Ignore:
Timestamp:
08/19/11 15:43:32 (10 years ago)
Author:
ehuelsmann
Message:

Re #116: Implement some infrastructure to load from other sources than
plain java.lang.String-s.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/Lisp.java

    r13445 r13512  
    3535
    3636import java.io.File;
    37 import java.io.FileInputStream;
    38 import java.io.FileNotFoundException;
    3937import java.io.IOException;
    4038import java.io.InputStream;
     39import java.io.InputStreamReader;
     40import java.io.Reader;
     41import java.io.StringReader;
    4142import java.math.BigInteger;
    42 import java.net.MalformedURLException;
    4343import java.net.URL;
    44 import java.net.URLDecoder;
     44import java.nio.charset.Charset;
    4545import java.util.Hashtable;
    4646
     
    12401240
    12411241  // Used by the compiler.
    1242   public static final LispObject readObjectFromString(String s)
     1242  public static LispObject readObjectFromString(String s)
     1243  {
     1244      return readObjectFromReader(new StringReader(s));
     1245  }
     1246 
     1247  final static Charset UTF8CHARSET = Charset.forName("UTF-8");
     1248  public static LispObject readObjectFromStream(InputStream s)
     1249  {
     1250      return readObjectFromReader(new InputStreamReader(s));
     1251  }
     1252 
     1253  public static LispObject readObjectFromReader(Reader r)
    12431254  {
    12441255    LispThread thread = LispThread.currentThread();
     
    12541265        // No need to bind the default read table, because the default fasl
    12551266        // read table is used below
    1256         return new StringInputStream(s).read(true, NIL, false,
     1267        return new Stream(Symbol.SYSTEM_STREAM, r).read(true, NIL, false,
    12571268                                             LispThread.currentThread(),
    12581269                                             Stream.faslReadtable);
     
    12621273    }
    12631274  }
    1264 
    1265     @Deprecated
     1275 
     1276  @Deprecated
    12661277  public static final LispObject loadCompiledFunction(final String namestring)
    12671278  {
Note: See TracChangeset for help on using the changeset viewer.