First time writing.
Just write the binary form of a picture to read the byte  array to the procedure, there is a problem: cycles InputStream.read (byte  buffer), each read a certain amount of bytes (the number of unknown) data, the buffer will be an unprecedented array of clean, so must be the buffer to save time, the final will all be combined into a total buffer of the buffer array, just realized, fear of forgetting, feel the need to record look!
image object has three attributes, id, name and content, types are: int, String, byte 
InputStream is = fileItem.getInputStream ();
Image image = new Image ();
image.setName (fileItem.getName ());
byte  buffer = new byte [1024 * 50];
int length = 0;
int lastLength = 0;
byte  totalBuffer = new byte [1024 * 50];
for (lastLength = length; (length = is.read (buffer))> 0;) (
System.arraycopy (buffer, 0, totalBuffer, lastLength, length);
This is a major, the other file upload is not like that, and there's really nothing!