Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
public final class ArtFormats
- Object
- 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.Fields
public static final int MAX_BYTES = 536870912 | The largest file read. |
Methods
Inherited methods
Field details
MAX_BYTES
public static final int MAX_BYTES = 536870912The largest file read.
Method details
read
public static ArtDocument read(InputStream in)
throws IOExceptionReads a document.
Parameters
inInputStream- the file; read to its end, not closed
Throws
read
public static ArtDocument read(byte[] data)
throws IOExceptionReads a document from bytes.
Parameters
databyte[]- the file
Throws
detect
public static String detect(byte[] data)The format of a file: “psd”, “svg”, “sketch”, “cn1gfx”, “figma” or null.
Parameters
databyte[]- the start of the file; a few kilobytes are enough