public static String _printBase64Binary(byte[] input) { return _printBase64Binary(input, 0, input.length); }
public static String _printBase64Binary(byte[] input, int offset, int len) { char[] buf = new char[((len + 2) / 3) * 4]; int ptr = _printBase64Binary(input, offset, len, buf, 0); assert ptr == buf.length; return new String(buf); }
@Deprecated public String printBase64Binary(byte[] val) { return _printBase64Binary(val); }
@Override public void writeTo(char[] buf, int start) { get(); DatatypeConverterImpl._printBase64Binary(data, 0, dataLen, buf, start); }
/** * Returns the base64 encoded string of this data. */ public String toString() { get(); // fill in the buffer return DatatypeConverterImpl._printBase64Binary(data, 0, dataLen); }
public void writeTo(XMLStreamWriter output) throws IOException, XMLStreamException { get(); DatatypeConverterImpl._printBase64Binary(data, 0, dataLen, output); }
/** * 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; } }
public static String _printBase64Binary(byte[] input) { return _printBase64Binary(input, 0, input.length); }
public static String _printBase64Binary(byte[] input, int offset, int len) { char[] buf = new char[((len + 2) / 3) * 4]; int ptr = _printBase64Binary(input, offset, len, buf, 0); assert ptr == buf.length; return new String(buf); }
@Deprecated public String printBase64Binary(byte[] val) { return _printBase64Binary(val); }
@Override public void writeTo(char[] buf, int start) { get(); DatatypeConverterImpl._printBase64Binary(data, 0, dataLen, buf, start); }
/** * Returns the base64 encoded string of this data. */ public String toString() { get(); // fill in the buffer return DatatypeConverterImpl._printBase64Binary(data, 0, dataLen); }
public void writeTo(XMLStreamWriter output) throws IOException, XMLStreamException { get(); DatatypeConverterImpl._printBase64Binary(data, 0, dataLen, output); }
/** * 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; } }
public static String _printBase64Binary(byte[] input, int offset, int len) { char[] buf = new char[((len + 2) / 3) * 4]; int ptr = _printBase64Binary(input, offset, len, buf, 0); assert ptr == buf.length; return new String(buf); }
@Deprecated public String printBase64Binary(byte[] val) { return _printBase64Binary(val); }
/** * Returns the base64 encoded string of this data. */ public String toString() { get(); // fill in the buffer return DatatypeConverterImpl._printBase64Binary(data, 0, dataLen); }
@Override public void writeTo(char[] buf, int start) { get(); DatatypeConverterImpl._printBase64Binary(data, 0, dataLen, buf, start); }
@Override public void writeBinary(byte[] data, int start, int len, String contentType) throws XMLStreamException { //check threshold and if less write as base64encoded value if(myMtomFeature.getThreshold() > len){ writeCharacters(DatatypeConverterImpl._printBase64Binary(data, start, len)); return; } ByteArrayBuffer bab = new ByteArrayBuffer(new DataHandler(new ByteArrayDataSource(data, start, len, contentType)), boundary); writeBinary(bab); }
@Override public void writeBinary(byte[] data, int start, int len, String contentType) throws XMLStreamException { //check threshold and if less write as base64encoded value if(myMtomFeature.getThreshold() > len){ writeCharacters(DatatypeConverterImpl._printBase64Binary(data, start, len)); return; } ByteArrayBuffer bab = new ByteArrayBuffer(new DataHandler(new ByteArrayDataSource(data, start, len, contentType)), boundary); writeBinary(bab); }