public void writeTo(OutputStream os) throws IOException { // the message should not change between the constructor and this call try { if (buf != null) os.write(buf, 0, msgSize); else { os = new CRLFOutputStream(os); msg.writeTo(os); } } catch (MessagingException mex) { // exceptions here are bad, "should" never happen throw new IOException("MessagingException while appending message: " + mex); } } }
@Override public void writeTo(OutputStream os) throws IOException { // the message should not change between the constructor and this call try { if (buf != null) os.write(buf, 0, msgSize); else { os = new CRLFOutputStream(os); msg.writeTo(os); } } catch (MessagingException mex) { // exceptions here are bad, "should" never happen throw new IOException("MessagingException while appending message: " + mex); } } }
public MessageLiteral(Message msg, int maxsize) throws MessagingException, IOException { this.msg = msg; // compute the size here so exceptions can be returned immediately LengthCounter lc = new LengthCounter(maxsize); OutputStream os = new CRLFOutputStream(lc); msg.writeTo(os); os.flush(); msgSize = lc.getSize(); buf = lc.getBytes(); }
public MessageLiteral(Message msg, int maxsize) throws MessagingException, IOException { this.msg = msg; // compute the size here so exceptions can be returned immediately LengthCounter lc = new LengthCounter(maxsize); OutputStream os = new CRLFOutputStream(lc); msg.writeTo(os); os.flush(); msgSize = lc.getSize(); buf = lc.getBytes(); }
public void writeTo(OutputStream os) throws IOException { // the message should not change between the constructor and this call try { if (buf != null) os.write(buf, 0, msgSize); else { os = new CRLFOutputStream(os); msg.writeTo(os); } } catch (MessagingException mex) { // exceptions here are bad, "should" never happen throw new IOException("MessagingException while appending message: " + mex); } } }
public void writeTo(OutputStream os) throws IOException { // the message should not change between the constructor and this call try { if (buf != null) os.write(buf, 0, msgSize); else { os = new CRLFOutputStream(os); msg.writeTo(os); } } catch (MessagingException mex) { // exceptions here are bad, "should" never happen throw new IOException("MessagingException while appending message: " + mex); } } }
/** * Create a canonicalized version of a given mime message * * @param mimeMessage * the message to canonicalize * @return a mime message in the canonical form * @throws IOException * @throws MessagingException */ protected MimeMessage canonicalizeMessage(MimeMessage mimeMessage) throws IOException, MessagingException { ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); CRLFOutputStream crlfOutputStream = new CRLFOutputStream(byteArrayOutputStream); mimeMessage.writeTo(crlfOutputStream); return new MimeMessage((Session)null, new ByteArrayInputStream(byteArrayOutputStream.toByteArray())); }
public byte[] canonicalize(byte[] inputBytes) throws XWSSecurityException { ByteArrayOutputStream bout = new ByteArrayOutputStream(); CRLFOutputStream crlfOutStream = new CRLFOutputStream(bout); try { crlfOutStream.write(inputBytes); } catch (IOException e) { log.log(Level.SEVERE, "WSS1002.error.canonicalizing.textplain", new Object[] {e.getMessage()}); throw new XWSSecurityException(e); } return bout.toByteArray(); }
@Override public void writeTo(OutputStream os) throws IOException { // the message should not change between the constructor and this call try { if (buf != null) os.write(buf, 0, msgSize); else { os = new CRLFOutputStream(os); msg.writeTo(os); } } catch (MessagingException mex) { // exceptions here are bad, "should" never happen throw new IOException("MessagingException while appending message: " + mex); } } }
@Override public void writeTo(OutputStream os) throws IOException { // the message should not change between the constructor and this call try { if (buf != null) os.write(buf, 0, msgSize); else { os = new CRLFOutputStream(os); msg.writeTo(os); } } catch (MessagingException mex) { // exceptions here are bad, "should" never happen throw new IOException("MessagingException while appending message: " + mex); } } }
@Override public void writeTo(OutputStream os) throws IOException { // the message should not change between the constructor and this call try { if (buf != null) os.write(buf, 0, msgSize); else { os = new CRLFOutputStream(os); msg.writeTo(os); } } catch (MessagingException mex) { // exceptions here are bad, "should" never happen throw new IOException("MessagingException while appending message: " + mex); } } }
@Override public void writeTo(OutputStream os) throws IOException { // the message should not change between the constructor and this call try { if (buf != null) os.write(buf, 0, msgSize); else { os = new CRLFOutputStream(os); msg.writeTo(os); } } catch (MessagingException mex) { // exceptions here are bad, "should" never happen throw new IOException("MessagingException while appending message: " + mex); } } }
if(outputStream == null){ bout = new ByteArrayOutputStream(); crlfOutStream = new CRLFOutputStream(bout); }else{ crlfOutStream = new CRLFOutputStream(outputStream);
public MessageLiteral(Message msg, int maxsize) throws MessagingException, IOException { this.msg = msg; // compute the size here so exceptions can be returned immediately LengthCounter lc = new LengthCounter(maxsize); OutputStream os = new CRLFOutputStream(lc); msg.writeTo(os); os.flush(); msgSize = lc.getSize(); buf = lc.getBytes(); }
public MessageLiteral(Message msg, int maxsize) throws MessagingException, IOException { this.msg = msg; // compute the size here so exceptions can be returned immediately LengthCounter lc = new LengthCounter(maxsize); OutputStream os = new CRLFOutputStream(lc); msg.writeTo(os); os.flush(); msgSize = lc.getSize(); buf = lc.getBytes(); }
public MessageLiteral(Message msg, int maxsize) throws MessagingException, IOException { this.msg = msg; // compute the size here so exceptions can be returned immediately LengthCounter lc = new LengthCounter(maxsize); OutputStream os = new CRLFOutputStream(lc); msg.writeTo(os); os.flush(); msgSize = lc.getSize(); buf = lc.getBytes(); }
public MessageLiteral(Message msg, int maxsize) throws MessagingException, IOException { this.msg = msg; // compute the size here so exceptions can be returned immediately LengthCounter lc = new LengthCounter(maxsize); OutputStream os = new CRLFOutputStream(lc); msg.writeTo(os); os.flush(); msgSize = lc.getSize(); buf = lc.getBytes(); }
public MessageLiteral(Message msg, int maxsize) throws MessagingException, IOException { this.msg = msg; // compute the size here so exceptions can be returned immediately LengthCounter lc = new LengthCounter(maxsize); OutputStream os = new CRLFOutputStream(lc); msg.writeTo(os); os.flush(); msgSize = lc.getSize(); buf = lc.getBytes(); }
public MessageLiteral(Message msg, int maxsize) throws MessagingException, IOException { this.msg = msg; // compute the size here so exceptions can be returned immediately LengthCounter lc = new LengthCounter(maxsize); OutputStream os = new CRLFOutputStream(lc); msg.writeTo(os); os.flush(); msgSize = lc.getSize(); buf = lc.getBytes(); }