Java XML Data Type Converter writeOpaqueValue(final String opaque)

Here you can find the source of writeOpaqueValue(final String opaque)

Description

write Opaque Value

License

Open Source License

Declaration

private static byte[] writeOpaqueValue(final String opaque) 

Method Source Code

//package com.java2s;
/*//from   w ww. j a  v a2  s.c  o m
 * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
 * and is available at http://www.eclipse.org/legal/epl-v10.html
 */

import javax.xml.bind.DatatypeConverter;

public class Main {
    private static final String SEPARATOR = ":";
    private static final String EMPTY_SEPARATOR = "";

    private static byte[] writeOpaqueValue(final String opaque) {
        final String joined = opaque.replace(SEPARATOR, EMPTY_SEPARATOR);
        return DatatypeConverter.parseHexBinary(joined);
    }
}

Related

  1. toString(final Serializable o)
  2. toString(Serializable o)
  3. toTime(String st)
  4. unserializeURLSafe(String string)
  5. writeKey(Writer writer, PublicKey publicKey)