Java Code Examples for com.sun.xml.internal.org.jvnet.staxex.Base64Data#set()

The following examples show how to use com.sun.xml.internal.org.jvnet.staxex.Base64Data#set() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StreamWriterBufferCreator.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void writeBinary(byte[] bytes, int offset, int length, String endpointURL) throws XMLStreamException {
    Base64Data d = new Base64Data();
    byte b[] = new byte[length];
    System.arraycopy(bytes, offset, b, 0, length);
    d.set(b, length, null, true);
    storeStructure(T_TEXT_AS_OBJECT);
    storeContentObject(d);
}
 
Example 2
Source File: StreamWriterBufferCreator.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void writeBinary(byte[] bytes, int offset, int length, String endpointURL) throws XMLStreamException {
    Base64Data d = new Base64Data();
    byte b[] = new byte[length];
    System.arraycopy(bytes, offset, b, 0, length);
    d.set(b, length, null, true);
    storeStructure(T_TEXT_AS_OBJECT);
    storeContentObject(d);
}
 
Example 3
Source File: StreamWriterBufferCreator.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void writeBinary(byte[] bytes, int offset, int length, String endpointURL) throws XMLStreamException {
    Base64Data d = new Base64Data();
    byte b[] = new byte[length];
    System.arraycopy(bytes, offset, b, 0, length);
    d.set(b, length, null, true);
    storeStructure(T_TEXT_AS_OBJECT);
    storeContentObject(d);
}
 
Example 4
Source File: MtomCodec.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
public int next() throws XMLStreamException {
    int event = reader.next();
    if (event == XMLStreamConstants.START_ELEMENT && reader.getLocalName().equals(XOP_LOCALNAME) && reader.getNamespaceURI().equals(XOP_NAMESPACEURI)) {
        //its xop reference, take the URI reference
        String href = reader.getAttributeValue(null, "href");
        try {
            xopHref = href;
            Attachment att = getAttachment(href);
            if(att != null){
                DataHandler dh = att.asDataHandler();
                if (dh instanceof StreamingDataHandler) {
                    ((StreamingDataHandler)dh).setHrefCid(att.getContentId());
                }
                base64AttData = new Base64Data();
                base64AttData.set(dh);
            }
            xopReferencePresent = true;
        } catch (IOException e) {
            throw new WebServiceException(e);
        }
        //move to the </xop:Include>
        XMLStreamReaderUtil.nextElementContent(reader);
        return XMLStreamConstants.CHARACTERS;
    }
    if(xopReferencePresent){
        xopReferencePresent = false;
        base64EncodedText = null;
        xopHref = null;
    }
    return event;
}
 
Example 5
Source File: StreamWriterBufferCreator.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void writeBinary(byte[] bytes, int offset, int length, String endpointURL) throws XMLStreamException {
    Base64Data d = new Base64Data();
    byte b[] = new byte[length];
    System.arraycopy(bytes, offset, b, 0, length);
    d.set(b, length, null, true);
    storeStructure(T_TEXT_AS_OBJECT);
    storeContentObject(d);
}
 
Example 6
Source File: MtomCodec.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public int next() throws XMLStreamException {
    int event = reader.next();
    if (event == XMLStreamConstants.START_ELEMENT && reader.getLocalName().equals(XOP_LOCALNAME) && reader.getNamespaceURI().equals(XOP_NAMESPACEURI)) {
        //its xop reference, take the URI reference
        String href = reader.getAttributeValue(null, "href");
        try {
            xopHref = href;
            Attachment att = getAttachment(href);
            if(att != null){
                DataHandler dh = att.asDataHandler();
                if (dh instanceof StreamingDataHandler) {
                    ((StreamingDataHandler)dh).setHrefCid(att.getContentId());
                }
                base64AttData = new Base64Data();
                base64AttData.set(dh);
            }
            xopReferencePresent = true;
        } catch (IOException e) {
            throw new WebServiceException(e);
        }
        //move to the </xop:Include>
        XMLStreamReaderUtil.nextElementContent(reader);
        return XMLStreamConstants.CHARACTERS;
    }
    if(xopReferencePresent){
        xopReferencePresent = false;
        base64EncodedText = null;
        xopHref = null;
    }
    return event;
}
 
Example 7
Source File: MtomCodec.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public int next() throws XMLStreamException {
    int event = reader.next();
    if (event == XMLStreamConstants.START_ELEMENT && reader.getLocalName().equals(XOP_LOCALNAME) && reader.getNamespaceURI().equals(XOP_NAMESPACEURI)) {
        //its xop reference, take the URI reference
        String href = reader.getAttributeValue(null, "href");
        try {
            xopHref = href;
            Attachment att = getAttachment(href);
            if(att != null){
                DataHandler dh = att.asDataHandler();
                if (dh instanceof StreamingDataHandler) {
                    ((StreamingDataHandler)dh).setHrefCid(att.getContentId());
                }
                base64AttData = new Base64Data();
                base64AttData.set(dh);
            }
            xopReferencePresent = true;
        } catch (IOException e) {
            throw new WebServiceException(e);
        }
        //move to the </xop:Include>
        XMLStreamReaderUtil.nextElementContent(reader);
        return XMLStreamConstants.CHARACTERS;
    }
    if(xopReferencePresent){
        xopReferencePresent = false;
        base64EncodedText = null;
        xopHref = null;
    }
    return event;
}
 
Example 8
Source File: MtomCodec.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@Override
public int next() throws XMLStreamException {
    int event = reader.next();
    if (event == XMLStreamConstants.START_ELEMENT && reader.getLocalName().equals(XOP_LOCALNAME) && reader.getNamespaceURI().equals(XOP_NAMESPACEURI)) {
        //its xop reference, take the URI reference
        String href = reader.getAttributeValue(null, "href");
        try {
            xopHref = href;
            Attachment att = getAttachment(href);
            if(att != null){
                DataHandler dh = att.asDataHandler();
                if (dh instanceof StreamingDataHandler) {
                    ((StreamingDataHandler)dh).setHrefCid(att.getContentId());
                }
                base64AttData = new Base64Data();
                base64AttData.set(dh);
            }
            xopReferencePresent = true;
        } catch (IOException e) {
            throw new WebServiceException(e);
        }
        //move to the </xop:Include>
        XMLStreamReaderUtil.nextElementContent(reader);
        return XMLStreamConstants.CHARACTERS;
    }
    if(xopReferencePresent){
        xopReferencePresent = false;
        base64EncodedText = null;
        xopHref = null;
    }
    return event;
}
 
Example 9
Source File: StreamWriterBufferCreator.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void writeBinary(byte[] bytes, int offset, int length, String endpointURL) throws XMLStreamException {
    Base64Data d = new Base64Data();
    byte b[] = new byte[length];
    System.arraycopy(bytes, offset, b, 0, length);
    d.set(b, length, null, true);
    storeStructure(T_TEXT_AS_OBJECT);
    storeContentObject(d);
}
 
Example 10
Source File: StreamWriterBufferCreator.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void writeBinary(byte[] bytes, int offset, int length, String endpointURL) throws XMLStreamException {
    Base64Data d = new Base64Data();
    byte b[] = new byte[length];
    System.arraycopy(bytes, offset, b, 0, length);
    d.set(b, length, null, true);
    storeStructure(T_TEXT_AS_OBJECT);
    storeContentObject(d);
}
 
Example 11
Source File: StreamAttachment.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public Base64Data asBase64Data(){
    Base64Data base64Data = new Base64Data();
    base64Data.set(data, len, contentType);
    return base64Data;
}
 
Example 12
Source File: StreamAttachment.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public Base64Data asBase64Data(){
    Base64Data base64Data = new Base64Data();
    base64Data.set(data, len, contentType);
    return base64Data;
}
 
Example 13
Source File: StreamAttachment.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public Base64Data asBase64Data(){
    Base64Data base64Data = new Base64Data();
    base64Data.set(data, len, contentType);
    return base64Data;
}
 
Example 14
Source File: StreamWriterBufferCreator.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public void writeBinary(DataHandler dataHandler) throws XMLStreamException {
    Base64Data d = new Base64Data();
    d.set(dataHandler);
    storeStructure(T_TEXT_AS_OBJECT);
    storeContentObject(d);
}
 
Example 15
Source File: StreamWriterBufferCreator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public void writeBinary(DataHandler dataHandler) throws XMLStreamException {
    Base64Data d = new Base64Data();
    d.set(dataHandler);
    storeStructure(T_TEXT_AS_OBJECT);
    storeContentObject(d);
}
 
Example 16
Source File: StreamAttachment.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public Base64Data asBase64Data(){
    Base64Data base64Data = new Base64Data();
    base64Data.set(data, len, contentType);
    return base64Data;
}
 
Example 17
Source File: StreamAttachment.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public Base64Data asBase64Data(){
    Base64Data base64Data = new Base64Data();
    base64Data.set(data, len, contentType);
    return base64Data;
}
 
Example 18
Source File: StreamWriterBufferCreator.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public void writeBinary(DataHandler dataHandler) throws XMLStreamException {
    Base64Data d = new Base64Data();
    d.set(dataHandler);
    storeStructure(T_TEXT_AS_OBJECT);
    storeContentObject(d);
}
 
Example 19
Source File: StreamWriterBufferCreator.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public void writeBinary(DataHandler dataHandler) throws XMLStreamException {
    Base64Data d = new Base64Data();
    d.set(dataHandler);
    storeStructure(T_TEXT_AS_OBJECT);
    storeContentObject(d);
}
 
Example 20
Source File: StreamAttachment.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public Base64Data asBase64Data(){
    Base64Data base64Data = new Base64Data();
    base64Data.set(data, len, contentType);
    return base64Data;
}