Package org.xmlBlaster.client.protocol.http.common

Examples of org.xmlBlaster.client.protocol.http.common.BufferedInputStreamMicro


         ps.close();
         byte[] buf = baos.toByteArray();
         byte[] buf1 = new byte[buf.length];
         for (int i=0; i < buf.length; i++) buf1[i] = buf[i];
        
         BufferedInputStreamMicro bism = new BufferedInputStreamMicro(new ByteArrayInputStream(buf));
         BufferedReader br = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(buf1)));
         while (true) {
            String referenceLine = br.readLine(); // of the normal reader
            if (referenceLine == null)
               break;
            String lineToCheck = bism.readLine(); // must be the same as the corresponding reference since we expect same behaviour
            if (lineToCheck == null)
               assertTrue("the line to be checked is unexpectedly null", false);
            assertEquals("wrong content", referenceLine, lineToCheck);
         }
        
         String lineToCheck = bism.readLine(); // must be the same as the corresponding reference since we expect same behaviour
         assertTrue("The line to check must also be null", lineToCheck == null);
        
         log.info("testReadLine successfully completed");
      }
      catch (Exception ex) {
View Full Code Here


         try {
            Socket sock = this.serverSocket.accept();
            InputStream in = sock.getInputStream();
           
            if (this.isMicro) {
               BufferedInputStreamMicro br = new BufferedInputStreamMicro(in);
               while (true) {
                  String line = br.readLine();
                  if (line != null) this.lines.add(line);
                  else break;
               }
            }
            else {
               BufferedReader br = new BufferedReader(new InputStreamReader(in));
               while (true) {
                  String line = br.readLine();
                  if (line != null) this.lines.add(line);
                  else break;
               }
            }
            sock.close();           
View Full Code Here

TOP

Related Classes of org.xmlBlaster.client.protocol.http.common.BufferedInputStreamMicro

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.