comparison src/luan/modules/IoLuan.java @ 1493:471ef3e6a84e

more io
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 03 May 2020 00:12:15 -0600
parents c7b86342857f
children f04bfbb08721
comparison
equal deleted inserted replaced
1492:aaac1d29edea 1493:471ef3e6a84e
271 return; 271 return;
272 } 272 }
273 if( obj instanceof byte[] ) { 273 if( obj instanceof byte[] ) {
274 byte[] a = (byte[])obj; 274 byte[] a = (byte[])obj;
275 OutputStream out = outputStream(); 275 OutputStream out = outputStream();
276 Utils.copyAll(new ByteArrayInputStream(a),out); 276 out.write(a);
277 out.close(); 277 out.close();
278 return; 278 return;
279 } 279 }
280 if( obj instanceof LuanTable ) { 280 if( obj instanceof LuanTable ) {
281 LuanTable t = (LuanTable)obj; 281 LuanTable t = (LuanTable)obj;
282 Object java = t.rawGet("java"); 282 Object java = t.rawGet("java");
283 if( java instanceof LuanIn ) { 283 if( java instanceof LuanIn ) {
284 LuanIn luanIn = (LuanIn)java; 284 LuanIn luanIn = (LuanIn)java;
285 InputStream in = luanIn.inputStream(); 285 InputStream in = luanIn.inputStream();
286 OutputStream out = outputStream(); 286 OutputStream out = outputStream();
287 Utils.copyAll(in,out); 287 IoUtils.copyAll(in,out);
288 out.close(); 288 out.close();
289 in.close(); 289 in.close();
290 return; 290 return;
291 } 291 }
292 } 292 }