Package org.apache.poi.xssf.usermodel
Class XSSFPictureData
- java.lang.Object
-
- org.apache.poi.ooxml.POIXMLDocumentPart
-
- org.apache.poi.xssf.usermodel.XSSFPictureData
-
- All Implemented Interfaces:
PictureData
public class XSSFPictureData extends POIXMLDocumentPart implements PictureData
Raw picture data, normally attached to a SpreadsheetML Drawing. As a rule, pictures are stored in the /xl/media/ part of a SpreadsheetML package.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.poi.ooxml.POIXMLDocumentPart
POIXMLDocumentPart.RelationPart
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getData()
Gets the picture data as a byte array.java.lang.String
getMimeType()
Returns the mime type for the imageint
getPictureType()
Return an integer constant that specifies type of this picturejava.lang.String
suggestFileExtension()
Suggests a file extension for this image.-
Methods inherited from class org.apache.poi.ooxml.POIXMLDocumentPart
_invokeOnDocumentRead, addRelation, createRelationship, createRelationship, createRelationship, getPackagePart, getParent, getRelationById, getRelationId, getRelationPartById, getRelationParts, getRelations, isCommited, setCommited, toString
-
-
-
-
Method Detail
-
getData
public byte[] getData()
Gets the picture data as a byte array.Note, that this call might be expensive since all the picture data is copied into a temporary byte array. You can grab the picture data directly from the underlying package part as follows:
InputStream is = getPackagePart().getInputStream();
- Specified by:
getData
in interfacePictureData
- Returns:
- the picture data.
-
suggestFileExtension
public java.lang.String suggestFileExtension()
Suggests a file extension for this image.- Specified by:
suggestFileExtension
in interfacePictureData
- Returns:
- the file extension.
-
getPictureType
public int getPictureType()
Return an integer constant that specifies type of this picture- Specified by:
getPictureType
in interfacePictureData
- Returns:
- an integer constant that specifies type of this picture
- See Also:
Workbook.PICTURE_TYPE_EMF
,Workbook.PICTURE_TYPE_WMF
,Workbook.PICTURE_TYPE_PICT
,Workbook.PICTURE_TYPE_JPEG
,Workbook.PICTURE_TYPE_PNG
,Workbook.PICTURE_TYPE_DIB
-
getMimeType
public java.lang.String getMimeType()
Description copied from interface:PictureData
Returns the mime type for the image- Specified by:
getMimeType
in interfacePictureData
-
-