public void text(String value, boolean needSP) throws IOException { closeStartTag(); if(needSP) write(' '); doText(value,false); }
public void text(Pcdata value, boolean needSP) throws IOException { closeStartTag(); if(needSP) write(' '); value.writeTo(this); }
/** * 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 final void text(int value) throws IOException { closeStartTag(); /* * TODO * Change to use the octet buffer directly */ // max is -2147483648 and 11 digits boolean minus = (value<0); textBuffer.ensureSize(11); byte[] buf = textBuffer.buf; int idx = 11; do { int r = value%10; if(r<0) r = -r; buf[--idx] = (byte)('0'|r); // really measn 0x30+r but 0<=r<10, so bit-OR would do. value /= 10; } while(value!=0); if(minus) buf[--idx] = (byte)'-'; write(buf,idx,11-idx); }
public void beginStartTag(int prefix, String localName) throws IOException { closeStartTag(); int base= pushNsDecls(); write('<'); writeName(prefix,localName); writeNsDecls(base); }
@Override public void beginStartTag(Name name) throws IOException { closeStartTag(); int base = pushNsDecls(); write('<'); writeName(name); writeNsDecls(base); }
public void text(String value, boolean needSP) throws IOException { closeStartTag(); if(needSP) write(' '); doText(value,false); }
public void text(Pcdata value, boolean needSP) throws IOException { closeStartTag(); if(needSP) write(' '); value.writeTo(this); }
/** * 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 final void text(int value) throws IOException { closeStartTag(); /* * TODO * Change to use the octet buffer directly */ // max is -2147483648 and 11 digits boolean minus = (value<0); textBuffer.ensureSize(11); byte[] buf = textBuffer.buf; int idx = 11; do { int r = value%10; if(r<0) r = -r; buf[--idx] = (byte)('0'|r); // really measn 0x30+r but 0<=r<10, so bit-OR would do. value /= 10; } while(value!=0); if(minus) buf[--idx] = (byte)'-'; write(buf,idx,11-idx); }
public void beginStartTag(int prefix, String localName) throws IOException { closeStartTag(); int base= pushNsDecls(); write('<'); writeName(prefix,localName); writeNsDecls(base); }
@Override public void beginStartTag(Name name) throws IOException { closeStartTag(); int base = pushNsDecls(); write('<'); writeName(name); writeNsDecls(base); }
public void text(Pcdata value, boolean needSP) throws IOException { closeStartTag(); if(needSP) write(' '); value.writeTo(this); }
public void text(String value, boolean needSP) throws IOException { closeStartTag(); if(needSP) write(' '); doText(value,false); }
public void text(Pcdata value, boolean needSP) throws IOException { closeStartTag(); if(needSP) write(' '); value.writeTo(this); }
public void text(String value, boolean needSP) throws IOException { closeStartTag(); if(needSP) write(' '); doText(value,false); }
@Override public void beginStartTag(Name name) throws IOException { closeStartTag(); int base = pushNsDecls(); write('<'); writeName(name); writeNsDecls(base); }
@Override public void beginStartTag(Name name) throws IOException { closeStartTag(); int base = pushNsDecls(); write('<'); writeName(name); writeNsDecls(base); }
public void beginStartTag(int prefix, String localName) throws IOException { closeStartTag(); int base= pushNsDecls(); write('<'); writeName(prefix,localName); writeNsDecls(base); }
public void beginStartTag(int prefix, String localName) throws IOException { closeStartTag(); int base= pushNsDecls(); write('<'); writeName(prefix,localName); writeNsDecls(base); }