private Map<String, Object> unmarsallProperties(Buffer marshalledProperties) throws IOException { return MarshallingSupport.unmarshalPrimitiveMap(new DataInputStream(new ByteArrayInputStream(marshalledProperties)), MAX_PROPERTY_SIZE); }
public int read(byte[] b) throws IOException { return read(b, 0, b.length); }
private Map<String, Object> unmarsallProperties(Buffer marshalledProperties) throws IOException { return MarshallingSupport.unmarshalPrimitiveMap(new DataInputStream(new ByteArrayInputStream(marshalledProperties)), MAX_PROPERTY_SIZE); }
public int read(byte[] b) throws IOException { return read(b, 0, b.length); }
private Map<String, Object> unmarsallProperties(Buffer marshalledProperties) throws IOException { return MarshallingSupport.unmarshalPrimitiveMap(new DataInputStream(new ByteArrayInputStream(marshalledProperties))); }
public int read(byte[] b) throws IOException { return read(b, 0, b.length); }
private Map<String, Object> unmarsallProperties(Buffer marshalledProperties) throws IOException { return MarshallingSupport.unmarshalPrimitiveMap(new DataInputStream(new ByteArrayInputStream(marshalledProperties))); }
private void initializeReading() throws MessageNotReadableException { checkWriteOnlyBody(); if (this.dataIn == null) { Buffer buffer = getContent(); if (buffer == null) { buffer = new Buffer(new byte[]{}, 0, 0); } this.dataIn = new DataInputStream(new ByteArrayInputStream(buffer)); } }
private void initializeReading() throws MessageNotReadableException { checkWriteOnlyBody(); if (this.dataIn == null) { Buffer buffer = getContent(); if (buffer == null) { buffer = new Buffer(new byte[]{}, 0, 0); } this.dataIn = new DataInputStream(new ByteArrayInputStream(buffer)); } }
private InputStream getStream(Attachment<?> attachment) { byte[] content = null; if (attachment instanceof BinaryAttachment) { content = ((BinaryAttachment) attachment).getContent(); } else if (attachment instanceof TextAttachment) { content = ((TextAttachment) attachment).getContent().getBytes(); } else if (attachment instanceof YExportableAttachment) { return null; } return new ByteArrayInputStream(content); }
private void initializeReading() throws JMSException { checkWriteOnlyBody(); if (dataIn == null) { Buffer buffer = getContent(); if (buffer==null) { buffer = new Buffer(0); } dataIn = new DataInputStream(new ByteArrayInputStream(buffer)); this.length = buffer.getLength(); } }
private void initializeReading() throws JMSException { checkWriteOnlyBody(); if (dataIn == null) { Buffer buffer = getContent(); if (buffer==null) { buffer = new Buffer(0); } dataIn = new DataInputStream(new ByteArrayInputStream(buffer)); this.length = buffer.getLength(); } }
private void initializeReading() throws OpenwireException { checkWriteOnlyBody(); if (this.dataIn == null) { Buffer data = getContent(); if (data == null) { data = new Buffer(new byte[] {}, 0, 0); } InputStream is = new ByteArrayInputStream(data); if (isCompressed()) { is = new InflaterInputStream(is); is = new BufferedInputStream(is); } this.dataIn = new DataInputStream(is); } }
private void initializeReading() throws OpenwireException { checkWriteOnlyBody(); if (this.dataIn == null) { Buffer data = getContent(); if (data == null) { data = new Buffer(new byte[] {}, 0, 0); } InputStream is = new ByteArrayInputStream(data); if (isCompressed()) { is = new InflaterInputStream(is); is = new BufferedInputStream(is); } this.dataIn = new DataInputStream(is); } }
private String findStorageId(String harvestId, String packageType) throws IndexerException, IOException { Indexer indexer = (Indexer) ApplicationContextProvider.getApplicationContext().getBean("fascinatorIndexer"); SearchRequest request = new SearchRequest("harvestId:\"" + harvestId + "\""); request.addParam("fq", "packageType:" + packageType); ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); indexer.search(request, byteArrayOutputStream); SolrResult results = new SolrResult(new ByteArrayInputStream(byteArrayOutputStream.toByteArray())); int rows = results.getRows(); if (rows == 0) { return null; } else { return results.getResults().get(0).getString(null, "storage_id"); } }
InputStream is = new ByteArrayInputStream(content); if (isCompressed()) { is = new InflaterInputStream(is);
/** * Builds the message body from data * * @throws OpenwireException */ private void loadContent() throws OpenwireException { try { if (getContent() != null && map.isEmpty()) { Buffer content = getContent(); InputStream is = new ByteArrayInputStream(content); if (isCompressed()) { is = new InflaterInputStream(is); } DataInputStream dataIn = new DataInputStream(is); map = MarshallingSupport.unmarshalPrimitiveMap(dataIn); dataIn.close(); } } catch (IOException e) { throw new OpenwireException(e); } }
InputStream is = new ByteArrayInputStream(content); if (isCompressed()) { is = new InflaterInputStream(is);
/** * Builds the message body from data * * @throws OpenwireException */ private void loadContent() throws OpenwireException { try { if (getContent() != null && map.isEmpty()) { Buffer content = getContent(); InputStream is = new ByteArrayInputStream(content); if (isCompressed()) { is = new InflaterInputStream(is); } DataInputStream dataIn = new DataInputStream(is); map = MarshallingSupport.unmarshalPrimitiveMap(dataIn); dataIn.close(); } } catch (IOException e) { throw new OpenwireException(e); } }
private void initializeReading() throws OpenwireException { checkWriteOnlyBody(); if (dataIn == null) { Buffer data = getContent(); if (data == null) { data = new Buffer(new byte[] {}, 0, 0); } InputStream is = new ByteArrayInputStream(data); if (isCompressed()) { // keep track of the real length of the content if // we are compressed. try { DataInputStream dis = new DataInputStream(is); length = dis.readInt(); dis.close(); } catch (IOException e) { throw new OpenwireException(e); } is = new InflaterInputStream(is); } else { length = data.getLength(); } dataIn = new DataInputStream(is); } }