Package org.jasen.io

Examples of org.jasen.io.NonBlockingStreamReader


    OutputStream out = new ByteArrayOutputStream();
    InputStream in = null;
    String html = null;

    NonBlockingStreamReader reader = null;
    try {
      in = url.openStream();
      reader = new NonBlockingStreamReader();
      reader.read(in, out, readBufferSize, readTimeout, null);

      html = new String(((ByteArrayOutputStream)out).toByteArray());
    }
    catch (IOException e) {
      throw new JasenException(e);
View Full Code Here


     * @throws IOException If an error occurred during transit
     */
    public static void get(URL url, OutputStream out, int bufferSize, long timeout, StreamReaderListener listener) throws IOException {

    InputStream in = null;
    NonBlockingStreamReader reader = null;

    try {
      in = url.openConnection().getInputStream();
      reader = new NonBlockingStreamReader(listener);
      reader.read(in, out, bufferSize, timeout, null);
    }
    finally {
      if(in != null) {
        try {
          in.close();
View Full Code Here

TOP

Related Classes of org.jasen.io.NonBlockingStreamReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.