Package java.io

Examples of java.io.ByteArrayOutputStream.reset()


         result.setChild(new Widget());
         result.getChild().setValue("foo");
         result.getChild().setSecret("bar");

         // Reset our output stream so we can re-use it
         out.reset();

         // Now we're going to constrain result.child's secret field
         c.setConstraints(Arrays.asList(new String[] { "child.secret" }));
         MarshalUtils.marshalResult(c, out);
View Full Code Here


         val.setValue("foo");
         val.setSecret("bar");
         result.getWidgetMap().put("foo", val);

         // Reset our output stream again
         out.reset();

         // Constrain the "secret" field of the widgetMap map's values (sounds
         // confusing, I know...)
         c.setConstraints(Arrays.asList(new String[] { "widgetMap[value].secret" }));
         MarshalUtils.marshalResult(c, out);
View Full Code Here

         assert val != null;
         assert "foo".equals(val.getValue());
         assert val.getSecret() == null;

         // Reset our output stream
         out.reset();

         // Add a list to our result
         result.setWidgetList(new ArrayList<Widget>());
         Widget item = new Widget();
         item.setValue("foo");
View Full Code Here

         assert item != null;
         assert "foo".equals(item.getValue());
         assert item.getSecret() == null;

         // Reset our output stream
         out.reset();

         // Now constrain all secrets
         c.setConstraints(Arrays.asList(new String[] { "[" + Widget.class.getName() + "].secret" }));
         MarshalUtils.marshalResult(c, out);
View Full Code Here

                               new String[]{aRecipients[r]}, oRecType,
                               sTextPlain, sTextHtml, sEncoding,
                               sId, aAttachments, sUserDir, oPrntStrm);
      if (oByteOutStrm.size()>0) {
        aWarnings.add(aRecipients[r]+" "+oByteOutStrm.toString());
        oByteOutStrm.reset();
      }
    } // next
    oPrntStrm.close();
      oSssnHndlr.close();     
    }// fi (sJobTl)
View Full Code Here

                           aRecipients, aRecTypes,
                           sTextPlain, sTextHtml, sEncoding,
                           sId, aAttachments, sUserDir, oPrntStrm);
    if (oByteOutStrm.size()>0) {
      aWarnings.add(oByteOutStrm.toString());
      oByteOutStrm.reset();
    }
    oPrntStrm.close();
    oSssnHndlr.close();     

    if (DebugFile.trace) {
View Full Code Here

        assertEquals(bytes, bout2.toByteArray());
       
       
        String in = "QWxhZGRpbjpvcGVuIHNlc2FtZQ==";
        bout.reset();
        bout2.reset();
        Base64Utility.decode(in, bout);
        bytes = bout.toByteArray();
        assertEquals("Aladdin:open sesame", new String(bytes));
        StringWriter writer = new StringWriter();
        Base64Utility.encode(bytes, 0, bytes.length, writer);
View Full Code Here

            say("aaaab = true");
            showParens(r);
        }

        // Serialization test 2: serialize/deserialize used regexp
        out.reset();
        say("Deserialized (a*)b");
        new ObjectOutputStream(out).writeObject(r);
        in = new ByteArrayInputStream(out.toByteArray());
        r = (RE)new ObjectInputStream(in).readObject();
        if (r.getParenCount() != 0)
View Full Code Here

         BinaryRefAddr dsAddr = new BinaryRefAddr("ProxyData", proxyBytes);
         String factory = DataSourceFactory.class.getName();
         Reference dsRef = new Reference("javax.sql.DataSource", dsAddr, factory, null);
         referenceable.setReference(dsRef);
         // Set the VMID as the address local/remote indicator
         baos.reset();
         ObjectOutputStream oos2 = new ObjectOutputStream(baos);
         oos2.writeObject(DataSourceFactory.vmID);
         oos2.close();
         byte[] id = baos.toByteArray();
         BinaryRefAddr localAddr = new BinaryRefAddr("VMID", id);
View Full Code Here

                // convert to external encoding before hex conversion
                try {
                    writer.write(c);
                    writer.flush();
                } catch(IOException e) {
                    buf.reset();
                    continue;
                }
                byte[] ba = buf.toByteArray();
                for (int j = 0; j < ba.length; j++) {
                    // Converting each byte in the buffer
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.