Class ArtFormats
java.lang.Object
com.codename1.art.ArtFormats
Opens a graphics document in whichever format it is: PSD or PSB, SVG, Sketch,
.cn1gfx,
or Figma REST API JSON. The format is found from the bytes, not the name.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringdetect(byte[] data) The format of a file: "psd", "svg", "sketch", "cn1gfx", "figma" or null.static ArtDocumentread(byte[] data) Reads a document from bytes.static ArtDocumentread(InputStream in) Reads a document.
-
Field Details
-
MAX_BYTES
public static final int MAX_BYTESThe largest file read.- See Also:
-
-
Method Details
-
read
Reads a document.
Parameters
in: the file; read to its end, not closed
- Throws:
IOException
-
read
Reads a document from bytes.
Parameters
data: the file
- Throws:
IOException
-
detect
The format of a file: "psd", "svg", "sketch", "cn1gfx", "figma" or null.
Parameters
data: the start of the file; a few kilobytes are enough
-