// Path: upload-parser-core/src/main/java/com/github/elopteryx/upload/errors/MultipartException.java
// public class MultipartException extends IOException {
// 
//     /**
//      * Public constructor.
//      * @param message The exception message.
//      */
//     public MultipartException(final String message) {
//         super(message);
//     }
// }


import com.github.elopteryx.upload.errors.MultipartException;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
                    if (subState == Integer.MAX_VALUE) {
                        subState = boundary[2] == b ? 2 : 0;
                    }
                    if (b == boundary[subState]) {
                        subState++;
                        if (subState == boundary.length) {
                            subState = -1;
                        }
                    } else if (b == boundary[0]) {
                        subState = 1;
                    } else {
                        subState = 0;
                    }
                } else if (subState == -1) {
                    if (b == CR) {
                        subState = -2;
                    }
                } else if (subState == -2) {
                    if (b == LF) {
                        subState = 0;
                        state = 1;//preamble is done
                        headers = new Headers();
                        return;
                    } else {
                        subState = -1;
                    }
                }
            }
        }

// Path: upload-parser-core/src/main/java/com/github/elopteryx/upload/errors/MultipartException.java
// public class MultipartException extends IOException {
// 
//     /**
//      * Public constructor.
//      * @param message The exception message.
//      */
//     public MultipartException(final String message) {
//         super(message);
//     }
// }


// Path: upload-parser-core/src/main/java/com/github/elopteryx/upload/internal/MultipartParser.java
import com.github.elopteryx.upload.errors.MultipartException;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;

                    if (subState == Integer.MAX_VALUE) {
                        subState = boundary[2] == b ? 2 : 0;
                    }
                    if (b == boundary[subState]) {
                        subState++;
                        if (subState == boundary.length) {
                            subState = -1;
                        }
                    } else if (b == boundary[0]) {
                        subState = 1;
                    } else {
                        subState = 0;
                    }
                } else if (subState == -1) {
                    if (b == CR) {
                        subState = -2;
                    }
                } else if (subState == -2) {
                    if (b == LF) {
                        subState = 0;
                        state = 1;//preamble is done
                        headers = new Headers();
                        return;
                    } else {
                        subState = -1;
                    }
                }
            }
        }

        private void headerName(final ByteBuffer buffer) throws MultipartException {