Java Code Examples for com.sun.xml.internal.bind.DatatypeConverterImpl#_printBase64Binary

The following examples show how to use com.sun.xml.internal.bind.DatatypeConverterImpl#_printBase64Binary . 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: UTF8XmlOutput.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Writes the given byte[] as base64 encoded binary to the output.
 *
 * <p>
 * Being defined on this class allows this method to access the buffer directly,
 * which translates to a better performance.
 */
public void text(byte[] data, int dataLen) throws IOException {
    closeStartTag();

    int start = 0;

    while(dataLen>0) {
        // how many bytes (in data) can we write without overflowing the buffer?
        int batchSize = Math.min(((octetBuffer.length-octetBufferIndex)/4)*3,dataLen);

        // write the batch
        octetBufferIndex = DatatypeConverterImpl._printBase64Binary(data,start,batchSize,octetBuffer,octetBufferIndex);

        if(batchSize<dataLen)
            flushBuffer();

        start += batchSize;
        dataLen -= batchSize;

    }
}
 
Example 2
Source File: UTF8XmlOutput.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Writes the given byte[] as base64 encoded binary to the output.
 *
 * <p>
 * Being defined on this class allows this method to access the buffer directly,
 * which translates to a better performance.
 */
public void text(byte[] data, int dataLen) throws IOException {
    closeStartTag();

    int start = 0;

    while(dataLen>0) {
        // how many bytes (in data) can we write without overflowing the buffer?
        int batchSize = Math.min(((octetBuffer.length-octetBufferIndex)/4)*3,dataLen);

        // write the batch
        octetBufferIndex = DatatypeConverterImpl._printBase64Binary(data,start,batchSize,octetBuffer,octetBufferIndex);

        if(batchSize<dataLen)
            flushBuffer();

        start += batchSize;
        dataLen -= batchSize;

    }
}
 
Example 3
Source File: UTF8XmlOutput.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Writes the given byte[] as base64 encoded binary to the output.
 *
 * <p>
 * Being defined on this class allows this method to access the buffer directly,
 * which translates to a better performance.
 */
public void text(byte[] data, int dataLen) throws IOException {
    closeStartTag();

    int start = 0;

    while(dataLen>0) {
        // how many bytes (in data) can we write without overflowing the buffer?
        int batchSize = Math.min(((octetBuffer.length-octetBufferIndex)/4)*3,dataLen);

        // write the batch
        octetBufferIndex = DatatypeConverterImpl._printBase64Binary(data,start,batchSize,octetBuffer,octetBufferIndex);

        if(batchSize<dataLen)
            flushBuffer();

        start += batchSize;
        dataLen -= batchSize;

    }
}
 
Example 4
Source File: UTF8XmlOutput.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Writes the given byte[] as base64 encoded binary to the output.
 *
 * <p>
 * Being defined on this class allows this method to access the buffer directly,
 * which translates to a better performance.
 */
public void text(byte[] data, int dataLen) throws IOException {
    closeStartTag();

    int start = 0;

    while(dataLen>0) {
        // how many bytes (in data) can we write without overflowing the buffer?
        int batchSize = Math.min(((octetBuffer.length-octetBufferIndex)/4)*3,dataLen);

        // write the batch
        octetBufferIndex = DatatypeConverterImpl._printBase64Binary(data,start,batchSize,octetBuffer,octetBufferIndex);

        if(batchSize<dataLen)
            flushBuffer();

        start += batchSize;
        dataLen -= batchSize;

    }
}
 
Example 5
Source File: Base64Data.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public void writeTo(XMLStreamWriter output) throws IOException, XMLStreamException {
    get();
    DatatypeConverterImpl._printBase64Binary(data, 0, dataLen, output);
}
 
Example 6
Source File: Base64Data.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public void writeTo(XMLStreamWriter output) throws IOException, XMLStreamException {
    get();
    DatatypeConverterImpl._printBase64Binary(data, 0, dataLen, output);
}
 
Example 7
Source File: Base64Data.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void writeTo(char[] buf, int start) {
    get();
    DatatypeConverterImpl._printBase64Binary(data, 0, dataLen, buf, start);
}
 
Example 8
Source File: Base64Data.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Returns the base64 encoded string of this data.
 */
public String toString() {
    get();  // fill in the buffer
    return DatatypeConverterImpl._printBase64Binary(data, 0, dataLen);
}
 
Example 9
Source File: Base64Data.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public void writeTo(XMLStreamWriter output) throws IOException, XMLStreamException {
    get();
    DatatypeConverterImpl._printBase64Binary(data, 0, dataLen, output);
}
 
Example 10
Source File: Base64Data.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void writeTo(char[] buf, int start) {
    get();
    DatatypeConverterImpl._printBase64Binary(data, 0, dataLen, buf, start);
}
 
Example 11
Source File: Base64Data.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Returns the base64 encoded string of this data.
 */
public String toString() {
    get();  // fill in the buffer
    return DatatypeConverterImpl._printBase64Binary(data, 0, dataLen);
}
 
Example 12
Source File: Base64Data.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public void writeTo(XMLStreamWriter output) throws IOException, XMLStreamException {
    get();
    DatatypeConverterImpl._printBase64Binary(data, 0, dataLen, output);
}
 
Example 13
Source File: Base64Data.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Returns the base64 encoded string of this data.
 */
public String toString() {
    get();  // fill in the buffer
    return DatatypeConverterImpl._printBase64Binary(data, 0, dataLen);
}
 
Example 14
Source File: Base64Data.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public void writeTo(XMLStreamWriter output) throws IOException, XMLStreamException {
    get();
    DatatypeConverterImpl._printBase64Binary(data, 0, dataLen, output);
}
 
Example 15
Source File: Base64Data.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void writeTo(char[] buf, int start) {
    get();
    DatatypeConverterImpl._printBase64Binary(data, 0, dataLen, buf, start);
}
 
Example 16
Source File: Base64Data.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Returns the base64 encoded string of this data.
 */
public String toString() {
    get();  // fill in the buffer
    return DatatypeConverterImpl._printBase64Binary(data, 0, dataLen);
}
 
Example 17
Source File: Base64Data.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void writeTo(char[] buf, int start) {
    get();
    DatatypeConverterImpl._printBase64Binary(data, 0, dataLen, buf, start);
}
 
Example 18
Source File: Base64Data.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public void writeTo(XMLStreamWriter output) throws IOException, XMLStreamException {
    get();
    DatatypeConverterImpl._printBase64Binary(data, 0, dataLen, output);
}
 
Example 19
Source File: Base64Data.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Returns the base64 encoded string of this data.
 */
public String toString() {
    get();  // fill in the buffer
    return DatatypeConverterImpl._printBase64Binary(data, 0, dataLen);
}
 
Example 20
Source File: Base64Data.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Returns the base64 encoded string of this data.
 */
public String toString() {
    get();  // fill in the buffer
    return DatatypeConverterImpl._printBase64Binary(data, 0, dataLen);
}