}
private static MultiValueMap<String, String> parseMimeHeaders(InputStream inputStream) throws IOException {
MultiValueMap<String, String> mimeHeaders = new LinkedMultiValueMap<String, String>();
if (inputStream instanceof TransportInputStream) {
TransportInputStream transportInputStream = (TransportInputStream) inputStream;
for (Iterator<String> headerNames = transportInputStream.getHeaderNames(); headerNames.hasNext();) {
String headerName = headerNames.next();
for (Iterator<String> headerValues = transportInputStream.getHeaders(headerName);
headerValues.hasNext();) {
String headerValue = headerValues.next();
StringTokenizer tokenizer = new StringTokenizer(headerValue, ",");
while (tokenizer.hasMoreTokens()) {
mimeHeaders.add(headerName, tokenizer.nextToken().trim());