Lines Matching defs:data

47  * Fed to unmarshaller when the 'text' data is actually
48 * a virtual image of base64 encoding of the binary data
54 * reuse it with new data.
56 * Also used by the marshaller to write out the binary data
66 // either dataHandler or (data,dataLen,mimeType?) must be present
68 private byte[] data;
70 * Length of the valid data in {@link #data}.
74 * Optional MIME type of {@link #data}.
83 * Fills in the data object by a portion of the byte[].
86 * data[0] to data[len-1] are treated as the data.
88 public void set(byte[] data, int len, @Nullable String mimeType) {
89 this.data = data;
96 * Fills in the data object by the byte[] of the exact length.
98 * @param data
101 public void set(byte[] data, @Nullable String mimeType) {
102 set(data, data.length, mimeType);
106 * Fills in the data object by a {@link DataHandler}.
108 public void set(DataHandler data) {
109 assert data != null;
110 this.dataHandler = data;
111 this.data = null;
115 * Gets the raw data.
126 return new ByteArrayInputStream(data, 0, dataLen);
147 if (dataLen != data.length) {
149 System.arraycopy(data, 0, buf, 0, dataLen);
150 data = buf;
152 return data;
156 * Gets the data as an {@link InputStream}.
162 return new ByteArrayInputStream(data, 0, dataLen);
171 return data != null;
175 * Gets the raw data. The size of the byte array maybe larger than the actual length.
178 if (data == null) {
184 data = baos.getBuffer();
188 dataLen = 0; // recover by assuming length-0 data
191 return data;
207 * this binary data in the base64 encoding.
217 * Encode this binary data in the base64 encoding
232 return DatatypeConverterImpl.encode(data[base] >> 2);
235 b1 = data[base + 1];
240 ((data[base] & 0x3) << 4)
244 b1 = data[base + 1];
246 b2 = data[base + 2];
259 return DatatypeConverterImpl.encode(data[base + 2] & 0x3F);
283 * Returns the base64 encoded string of this data.
287 return DatatypeConverterImpl._printBase64Binary(data, 0, dataLen);
293 DatatypeConverterImpl._printBase64Binary(data, 0, dataLen, buf, start);
297 // TODO: this is inefficient if the data source is note byte[] but DataHandler
299 output.text(data, dataLen);
304 DatatypeConverterImpl._printBase64Binary(data, 0, dataLen, output);