comparison core/src/luan/modules/IoLuan.java @ 435:5b36f663a1b8

make members lower case
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 03 May 2015 21:28:49 -0600
parents c6bcb8859b93
children 2e79b47d02a2
comparison
equal deleted inserted replaced
434:472fc70853cd 435:5b36f663a1b8
35 import luan.LuanException; 35 import luan.LuanException;
36 36
37 37
38 public final class IoLuan { 38 public final class IoLuan {
39 39
40 private static void add(LuanTable t,String method,Class<?>... parameterTypes) throws NoSuchMethodException { 40 private static void add(LuanTable t,String method,Class... parameterTypes) throws NoSuchMethodException {
41 t.rawPut( method, new LuanJavaFunction(IoLuan.class.getMethod(method,parameterTypes),null) ); 41 t.rawPut( method, new LuanJavaFunction(IoLuan.class.getMethod(method,parameterTypes),null) );
42 } 42 }
43 43
44 public static String read_console_line(String prompt) throws IOException { 44 public static String read_console_line(String prompt) throws IOException {
45 if( prompt==null ) 45 if( prompt==null )
574 if( t == null ) 574 if( t == null )
575 return newSchemes(); 575 return newSchemes();
576 return t; 576 return t;
577 } 577 }
578 578
579 public static LuanTable Uri(LuanState luan,String name) throws LuanException { 579 public static LuanTable uri(LuanState luan,String name) throws LuanException {
580 int i = name.indexOf(':'); 580 int i = name.indexOf(':');
581 if( i == -1 ) 581 if( i == -1 )
582 throw luan.exception( "invalid Io name '"+name+"', missing scheme" ); 582 throw luan.exception( "invalid Io name '"+name+"', missing scheme" );
583 String scheme = name.substring(0,i); 583 String scheme = name.substring(0,i);
584 String location = name.substring(i+1); 584 String location = name.substring(i+1);
610 610
611 @Override public String to_string() { 611 @Override public String to_string() {
612 return socket.toString(); 612 return socket.toString();
613 } 613 }
614 614
615 public LuanTable Pickle_client(LuanState luan) throws IOException { 615 public LuanTable pickle_client(LuanState luan) throws IOException {
616 InputStream in = new BufferedInputStream(inputStream()); 616 InputStream in = new BufferedInputStream(inputStream());
617 OutputStream out = new BufferedOutputStream(outputStream()); 617 OutputStream out = new BufferedOutputStream(outputStream());
618 return new PickleClient(luan,in,out).table(); 618 return new PickleClient(luan,in,out).table();
619 } 619 }
620 620
625 } 625 }
626 626
627 @Override public LuanTable table() { 627 @Override public LuanTable table() {
628 LuanTable tbl = super.table(); 628 LuanTable tbl = super.table();
629 try { 629 try {
630 tbl.rawPut( "Pickle_client", new LuanJavaFunction( 630 tbl.rawPut( "pickle_client", new LuanJavaFunction(
631 LuanSocket.class.getMethod( "Pickle_client", LuanState.class ), this 631 LuanSocket.class.getMethod( "pickle_client", LuanState.class ), this
632 ) ); 632 ) );
633 tbl.rawPut( "run_pickle_server", new LuanJavaFunction( 633 tbl.rawPut( "run_pickle_server", new LuanJavaFunction(
634 LuanSocket.class.getMethod( "run_pickle_server", LuanState.class ), this 634 LuanSocket.class.getMethod( "run_pickle_server", LuanState.class ), this
635 ) ); 635 ) );
636 } catch(NoSuchMethodException e) { 636 } catch(NoSuchMethodException e) {