@Test public void testStreamReceive() throws Throwable { XMLChannel xMLChannel = new XMLChannel(new PostPackager(), new ServerSocket()); try { xMLChannel.streamReceive(); } catch (EOFException e) { return; } fail ("EOFException should have been raised"); }
protected byte[] streamReceive() throws IOException { int sp = 0; StringBuilder sb = new StringBuilder(); while (reader != null) { String s = reader.readLine(); if (s == null) throw new EOFException(); sb.append (s); if (s.contains("<" + XMLPackager.ISOMSG_TAG)) sp++; if (s.contains("</" + XMLPackager.ISOMSG_TAG + ">") && --sp <= 0) break; } if (sb.length() == 0) throw new EOFException(); return sb.toString().getBytes(); }
XMLChannel extends BaseChannel { protected byte[] streamReceive() throws IOException { int sp = 0; StringBuilder sb = new StringBuilder(); while (reader != null) { String s = reader.readLine(); if (s == null) throw new EOFException(); sb.append (s); if (s.contains("<" + XMLPackager.ISOMSG_TAG)) sp++; if (s.contains("</" + XMLPackager.ISOMSG_TAG + ">") && --sp <= 0) break; } if (sb.length() == 0) throw new EOFException(); return sb.toString().getBytes(); } }
XMLChannel extends BaseChannel { protected byte[] streamReceive() throws IOException { int sp = 0; StringBuilder sb = new StringBuilder(); while (reader != null) { String s = reader.readLine(); if (s == null) throw new EOFException(); sb.append (s); if (s.contains("<" + XMLPackager.ISOMSG_TAG)) sp++; if (s.contains("</" + XMLPackager.ISOMSG_TAG + ">") && --sp <= 0) break; } if (sb.length() == 0) throw new EOFException(); return sb.toString().getBytes(); } XMLChannel();  XMLChannel(String host, int port, ISOPackager p);  XMLChannel(ISOPackager p);  XMLChannel(ISOPackager p, ServerSocket serverSocket); }
XMLChannel extends BaseChannel { protected byte[] streamReceive() throws IOException { int sp = 0; StringBuilder sb = new StringBuilder(); while (reader != null) { String s = reader.readLine(); if (s == null) throw new EOFException(); sb.append (s); if (s.contains("<" + XMLPackager.ISOMSG_TAG)) sp++; if (s.contains("</" + XMLPackager.ISOMSG_TAG + ">") && --sp <= 0) break; } if (sb.length() == 0) throw new EOFException(); return sb.toString().getBytes(); } XMLChannel();  XMLChannel(String host, int port, ISOPackager p);  XMLChannel(ISOPackager p);  XMLChannel(ISOPackager p, ServerSocket serverSocket); void disconnect(); }
XMLChannel extends BaseChannel { protected byte[] streamReceive() throws IOException { int sp = 0; StringBuilder sb = new StringBuilder(); while (reader != null) { String s = reader.readLine(); if (s == null) throw new EOFException(); sb.append (s); if (s.contains("<" + XMLPackager.ISOMSG_TAG)) sp++; if (s.contains("</" + XMLPackager.ISOMSG_TAG + ">") && --sp <= 0) break; } if (sb.length() == 0) throw new EOFException(); return sb.toString().getBytes(); } XMLChannel();  XMLChannel(String host, int port, ISOPackager p);  XMLChannel(ISOPackager p);  XMLChannel(ISOPackager p, ServerSocket serverSocket); void disconnect();  }