public static char[] readCharBuffer( Reader input ) { try { CharBuf sw = CharBuf.create( DEFAULT_BUFFER_SIZE ); copy( input, sw ); return sw.toCharArray(); } finally { try { input.close(); } catch ( IOException e ) { Exceptions.handle( e ); } } }
public static String read( Reader input ) { try { CharBuf sw = CharBuf.create( DEFAULT_BUFFER_SIZE ); copy( input, sw ); return sw.toString(); } finally { try { input.close(); } catch ( IOException e ) { Exceptions.handle( e ); } } }
public static String read( Reader input ) { try { CharBuf sw = CharBuf.create( DEFAULT_BUFFER_SIZE ); copy( input, sw ); return sw.toString(); } finally { try { input.close(); } catch ( IOException e ) { Exceptions.handle( e ); } } }
public static char[] readCharBuffer( Reader input ) { try { CharBuf sw = CharBuf.create( DEFAULT_BUFFER_SIZE ); copy( input, sw ); return sw.toCharArray(); } finally { try { input.close(); } catch ( IOException e ) { Exceptions.handle( e ); } } }
public static CharBuf read( Reader input, CharBuf charBuf, final int bufSize, char[] copyBuffer ) { if ( charBuf == null ) { charBuf = CharBuf.create( bufSize ); } else { charBuf.readForRecycle(); } try { char[] buffer = charBuf.toCharArray(); int size = input.read( buffer ); if ( size != -1 ) { charBuf._len( size ); } if ( size < buffer.length ) { return charBuf; } copy( input, charBuf, copyBuffer ); } catch ( IOException e ) { Exceptions.handle( e ); } finally { try { input.close(); } catch ( IOException e ) { Exceptions.handle( e ); } } return charBuf; }
public static CharBuf read( Reader input, CharBuf charBuf, final int bufSize, char[] copyBuffer ) { if ( charBuf == null ) { charBuf = CharBuf.create( bufSize ); } else { charBuf.readForRecycle(); } try { char[] buffer = charBuf.toCharArray(); int size = input.read( buffer ); if ( size != -1 ) { charBuf._len( size ); } if ( size < buffer.length ) { return charBuf; } copy( input, charBuf, copyBuffer ); } catch ( IOException e ) { Exceptions.handle( e ); } finally { try { input.close(); } catch ( IOException e ) { Exceptions.handle( e ); } } return charBuf; }