Changeset 11404
- Timestamp:
- 11/30/08 13:32:16 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/open-external-format/src/org/armedbear/lisp/Stream.java
r11391 r11404 80 80 */ 81 81 protected int charPos; 82 82 83 83 // Binary input. 84 84 private BufferedInputStream in; … … 91 91 } 92 92 93 public Stream(InputStream inputStream, LispObject elementType) 94 { 95 this(inputStream, elementType, null); 96 } 97 98 93 99 // Input stream constructors. 94 public Stream(InputStream inputStream, LispObject elementType)100 public Stream(InputStream inputStream, LispObject elementType, String encoding) 95 101 { 96 102 this.elementType = elementType; … … 102 108 { 103 109 inputStreamReader = 104 new InputStreamReader(inputStream, "ISO-8859-1"); 110 (encoding == null) ? 111 new InputStreamReader(inputStream) 112 : new InputStreamReader(inputStream, encoding); 105 113 } 106 114 catch (java.io.UnsupportedEncodingException e) … … 128 136 } 129 137 138 public Stream(OutputStream outputStream, LispObject elementType) 139 { 140 this(outputStream, elementType, null); 141 } 142 130 143 // Output stream constructors. 131 public Stream(OutputStream outputStream, LispObject elementType )144 public Stream(OutputStream outputStream, LispObject elementType, String encoding) 132 145 { 133 146 this.elementType = elementType; … … 137 150 try 138 151 { 139 writer = new OutputStreamWriter(outputStream, "ISO-8859-1"); 152 writer = (encoding == null) ? 153 new OutputStreamWriter(outputStream) 154 : new OutputStreamWriter(outputStream, encoding); 140 155 } 141 156 catch (java.io.UnsupportedEncodingException e)
Note: See TracChangeset
for help on using the changeset viewer.