Package org.dcm4che3.data

Examples of org.dcm4che3.data.SpecificCharacterSet$Encoder


  {
    CommandMessage commandMessage = new CommandMessage();
    commandMessage.setOperation( CommandMessage.LOGIN_OPERATION );

    String credString = username + ":" + password;
    Encoder encoder = new Encoder( credString.length() );
    encoder.encode( credString.getBytes() );

    commandMessage.setBody( encoder.drain() );
    commandMessage.setDestination( DESTINATION );
    return commandMessage;
  }
View Full Code Here


    private CommandMessage createLoginCommandMessage() {
        CommandMessage commandMessage = new CommandMessage();
        commandMessage.setOperation(CommandMessage.LOGIN_OPERATION);

        String credString = username + ":" + password;
        Encoder encoder = new Encoder(credString.length());
        encoder.encode(credString.getBytes());

        commandMessage.setBody(encoder.drain());
        commandMessage.setDestination(DESTINATION);
        return commandMessage;
    }
View Full Code Here

    pHandler.startElement("", VALUE_TAG, VALUE_TAG, ZERO_ATTRIBUTES);
    pHandler.startElement("", BASE_64_TAG, BASE_64_TAG, ZERO_ATTRIBUTES);
    byte[] buffer = (byte[]) pObject;
    if (buffer.length > 0) {
      char[] charBuffer = new char[buffer.length >= 1024 ? 1024 : ((buffer.length+3)/4)*4];
      Encoder encoder = new Base64.SAXEncoder(charBuffer, 0, null, pHandler);
      try {
        encoder.write(buffer, 0, buffer.length);
        encoder.flush();
      } catch (Base64.SAXIOException e) {
        throw e.getSAXException();
      } catch (IOException e) {
        throw new SAXException(e);
      }
View Full Code Here

  public void write(final ContentHandler pHandler, Object pObject) throws SAXException {
    pHandler.startElement("", VALUE_TAG, VALUE_TAG, ZERO_ATTRIBUTES);
    pHandler.startElement("", SERIALIZABLE_TAG, EX_SERIALIZABLE_TAG, ZERO_ATTRIBUTES);
    char[] buffer = new char[1024];
    Encoder encoder = new Base64.SAXEncoder(buffer, 0, null, pHandler);
    try {
      OutputStream ostream = new EncoderOutputStream(encoder);
      ObjectOutputStream oos = new ObjectOutputStream(ostream);
      oos.writeObject(pObject);
      oos.close();
View Full Code Here

    pHandler.startElement("", VALUE_TAG, VALUE_TAG, ZERO_ATTRIBUTES);
    pHandler.startElement("", BASE_64_TAG, BASE_64_TAG, ZERO_ATTRIBUTES);
    byte[] buffer = (byte[]) pObject;
    if (buffer.length > 0) {
      char[] charBuffer = new char[buffer.length >= 1024 ? 1024 : ((buffer.length+3)/4)*4];
      Encoder encoder = new Base64.SAXEncoder(charBuffer, 0, null, pHandler);
      try {
        encoder.write(buffer, 0, buffer.length);
        encoder.flush();
      } catch (Base64.SAXIOException e) {
        throw e.getSAXException();
      } catch (IOException e) {
        throw new SAXException(e);
      }
View Full Code Here

  public void write(final ContentHandler pHandler, Object pObject) throws SAXException {
    pHandler.startElement("", VALUE_TAG, VALUE_TAG, ZERO_ATTRIBUTES);
    pHandler.startElement("", SERIALIZABLE_TAG, EX_SERIALIZABLE_TAG, ZERO_ATTRIBUTES);
    char[] buffer = new char[1024];
    Encoder encoder = new Base64.SAXEncoder(buffer, 0, null, pHandler);
    try {
      OutputStream ostream = new EncoderOutputStream(encoder);
      ObjectOutputStream oos = new ObjectOutputStream(ostream);
      oos.writeObject(pObject);
      oos.close();
View Full Code Here

  public void write(final ContentHandler pHandler, Object pObject) throws SAXException {
    pHandler.startElement("", VALUE_TAG, VALUE_TAG, ZERO_ATTRIBUTES);
    pHandler.startElement("", BASE_64_TAG, BASE_64_TAG, ZERO_ATTRIBUTES);
    byte[] buffer = (byte[]) pObject;
    char[] charBuffer = new char[buffer.length >= 1024 ? 1024 : ((buffer.length+3)/4)*4];
    Encoder encoder = new Base64.SAXEncoder(charBuffer, 0, null, pHandler);
    try {
      encoder.write(buffer, 0, buffer.length);
      encoder.flush();
    } catch (Base64.SAXIOException e) {
      throw e.getSAXException();
    } catch (IOException e) {
      throw new SAXException(e);
    }
View Full Code Here

            String userID,
            String alternativeUserID,
            String userName,
            String hostName,
            RoleIDCode... roleIDs) {
        ActiveParticipant ap = new ActiveParticipant();
        ap.setUserID(userID);
        ap.setAlternativeUserID(alternativeUserID);
        ap.setUserName(userName);
        ap.setUserIsRequestor(requestor);
        ap.setNetworkAccessPointID(hostName);
        ap.setNetworkAccessPointTypeCode(AuditMessages.isIP(hostName)
                ? AuditMessages.NetworkAccessPointTypeCode.IPAddress
                : AuditMessages.NetworkAccessPointTypeCode.MachineName);
        for (RoleIDCode roleID : roleIDs)
            ap.getRoleIDCode().add(roleID);
        return ap;
    }
View Full Code Here

            ap.getRoleIDCode().add(roleID);
        return ap;
    }

    public AuditSourceIdentification createAuditSourceIdentification() {
        AuditSourceIdentification asi = new AuditSourceIdentification();
        asi.setAuditSourceID(auditSourceID());
        if (auditEnterpriseSiteID != null) {
            if (auditEnterpriseSiteID.equals("dicomInstitutionName")) {
                String[] institutionNames = getDevice().getInstitutionNames();
                if (institutionNames.length > 0)
                    asi.setAuditEnterpriseSiteID(institutionNames[0]);
            } else
                asi.setAuditEnterpriseSiteID(auditEnterpriseSiteID);
        }
        for (String code : auditSourceTypeCodes) {
            if (code.equals("dicomPrimaryDeviceType")) {
                for (String type : device.getPrimaryDeviceTypes()) {
                    AuditSourceTypeCode astc = new AuditSourceTypeCode();
                    astc.setCode(type);
                    astc.setCodeSystemName("DCM");
                    asi.getAuditSourceTypeCode().add(astc);
                }
            } else {
                AuditSourceTypeCode astc = new AuditSourceTypeCode();
                astc.setCode(code);
                asi.getAuditSourceTypeCode().add(astc );
            }
        }
        return asi ;
    }
View Full Code Here

                asi.setAuditEnterpriseSiteID(auditEnterpriseSiteID);
        }
        for (String code : auditSourceTypeCodes) {
            if (code.equals("dicomPrimaryDeviceType")) {
                for (String type : device.getPrimaryDeviceTypes()) {
                    AuditSourceTypeCode astc = new AuditSourceTypeCode();
                    astc.setCode(type);
                    astc.setCodeSystemName("DCM");
                    asi.getAuditSourceTypeCode().add(astc);
                }
            } else {
                AuditSourceTypeCode astc = new AuditSourceTypeCode();
                astc.setCode(code);
                asi.getAuditSourceTypeCode().add(astc );
            }
        }
        return asi ;
    }
View Full Code Here

TOP

Related Classes of org.dcm4che3.data.SpecificCharacterSet$Encoder

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.