public void readFrom ( InputStream input ) throws ApplicationUnavailableException , AttachmentLengthExceededException { OutputStream output = null ; try { output = getInstance ( ) . getWriter ( this , getContentType ( ) ) ; V1Util . copyStream ( input , output ) ; getInstance ( ) . commitWriteStream ( this ) ; } catch ( IOException e ) { throw new ApplicationUnavailableException ( e ) ; } finally { if ( output != null ) { try { output . close ( ) ; } catch ( IOException e ) { // do nothing } } } }
Read the attachment s content from the input stream . Set the ContentType and Filename properties before calling this method .