public byte [ ] getRawData ( ) throws IOException { int contentLength = request . getContentLength ( ) ; if ( contentLength < 0 ) { return null ; } byte [ ] buffer = new byte [ contentLength ] ; ServletInputStream is = request . getInputStream ( ) ; for ( int i = 0 ; i < contentLength ; ) { int rLen = is . read ( buffer , i , contentLength - i ) ; if ( rLen == - 1 ) { break ; } i += rLen ; } return buffer ; }
get the original raw data