Iterator<ByteBuffer> getBlockIterator() { return (getSize() > 0 ? _stream : Collections.<ByteBuffer>emptyList()).iterator(); }
/** * Provides a short description of the object, to be used when a * POIFSViewable object has not provided its contents. * * @return short description */ public String getShortDescription() { return "Document: \"" + _property.getName() + "\" size = " + getSize(); } }
/** * Create an InputStream from the specified Document * * @param document the Document to be read */ public DocumentInputStream(POIFSDocument document) { _current_offset = 0; _current_block_count = 0; _marked_offset = 0; _marked_offset_count = 0; _document_size = document.getSize(); _closed = false; _document = document; _data = _document.getBlockIterator(); }
/** * Get an array of objects, some of which may implement POIFSViewable * * @return an array of Object; may not be null, but may be empty */ public Object[] getViewableArray() { String result = "<NO DATA>"; if(getSize() > 0) { // Get all the data into a single array byte[] data = IOUtils.safelyAllocate(getSize(), MAX_RECORD_LENGTH); int offset = 0; for(ByteBuffer buffer : _stream) { int length = Math.min(_block_size, data.length-offset); buffer.get(data, offset, length); offset += length; } result = HexDump.dump(data, 0, 0); } return new String[]{ result }; }
Iterator<ByteBuffer> getBlockIterator() { return (getSize() > 0 ? _stream : Collections.<ByteBuffer>emptyList()).iterator(); }
/** * Provides a short description of the object, to be used when a * POIFSViewable object has not provided its contents. * * @return short description */ public String getShortDescription() { return "Document: \"" + _property.getName() + "\" size = " + getSize(); } }
/** * Provides a short description of the object, to be used when a * POIFSViewable object has not provided its contents. * * @return short description */ public String getShortDescription() { StringBuffer buffer = new StringBuffer(); buffer.append("Document: \"").append(_property.getName()).append("\""); buffer.append(" size = ").append(getSize()); return buffer.toString(); }
/** * Provides a short description of the object, to be used when a * POIFSViewable object has not provided its contents. * * @return short description */ public String getShortDescription() { StringBuffer buffer = new StringBuffer(); buffer.append("Document: \"").append(_property.getName()).append("\""); buffer.append(" size = ").append(getSize()); return buffer.toString(); }
/** * Create an InputStream from the specified Document * * @param document the Document to be read */ public ODocumentInputStream(POIFSDocument document) { _current_offset = 0; _marked_offset = 0; _document_size = document.getSize(); _closed = false; _document = document; _currentBlock = getDataInputBlock(0); }
/** * Create an InputStream from the specified Document * * @param document the Document to be read */ public ODocumentInputStream(POIFSDocument document) { _current_offset = 0; _marked_offset = 0; _document_size = document.getSize(); _closed = false; _document = document; _currentBlock = getDataInputBlock(0); }
/** * Create an InputStream from the specified Document * * @param document the Document to be read */ public DocumentInputStream(POIFSDocument document) { _current_offset = 0; _current_block_count = 0; _marked_offset = 0; _marked_offset_count = 0; _document_size = document.getSize(); _closed = false; _document = document; _data = _document.getBlockIterator(); }
/** * Get an array of objects, some of which may implement POIFSViewable * * @return an array of Object; may not be null, but may be empty */ public Object[] getViewableArray() { String result = "<NO DATA>"; if(getSize() > 0) { // Get all the data into a single array byte[] data = IOUtils.safelyAllocate(getSize(), MAX_RECORD_LENGTH); int offset = 0; for(ByteBuffer buffer : _stream) { int length = Math.min(_block_size, data.length-offset); buffer.get(data, offset, length); offset += length; } result = HexDump.dump(data, 0, 0); } return new String[]{ result }; }