* @throws Exception
*/
protected void checkBoundaryDetection(byte[] input, String boundary,
byte[] expected) throws Exception {
ByteArrayInputStream bais = new ByteArrayInputStream(input);
SimpleMultiPartInputStream smpis = new SimpleMultiPartInputStream(bais,
boundary);
ByteArrayOutputStream resultStream = new ByteArrayOutputStream();
int outbyte;
try {
while ((outbyte = smpis.read()) != -1) {
resultStream.write(outbyte);
}
} catch (IOException e) {
throw new IOException(e.getMessage() + "; expected "
+ new String(expected) + " but got "