@Override public boolean markSupported() { return getByteArrayInputStream().markSupported(); }
/** * Determines the mimeType of a formatter from the getHead call. * This could be made protected, or a new class could be created to do * this type of conversion. Currently, this is only used for the body * since the attachments are computed by filename. * Package-private for unit testing. * @param head any head string. * @return return the mime type or null for text/plain. */ final String contentTypeOf(String head) { if (!isEmpty(head)) { final int MAX_CHARS = 25; if (head.length() > MAX_CHARS) { head = head.substring(0, MAX_CHARS); } try { final String charset = getEncodingName(); final ByteArrayInputStream in = new ByteArrayInputStream(head.getBytes(charset)); assert in.markSupported() : in.getClass().getName(); return URLConnection.guessContentTypeFromStream(in); } catch (final IOException IOE) { reportError(IOE.getMessage(), IOE, ErrorManager.FORMAT_FAILURE); } } return null; //text/plain }
/** * Determines the mimeType of a formatter from the getHead call. * This could be made protected, or a new class could be created to do * this type of conversion. Currently, this is only used for the body * since the attachments are computed by filename. * Package-private for unit testing. * @param chunk any char sequence or null. * @return return the mime type or null for text/plain. */ final String contentTypeOf(CharSequence chunk) { if (!isEmpty(chunk)) { final int MAX_CHARS = 25; if (chunk.length() > MAX_CHARS) { chunk = chunk.subSequence(0, MAX_CHARS); } try { final String charset = getEncodingName(); final byte[] b = chunk.toString().getBytes(charset); final ByteArrayInputStream in = new ByteArrayInputStream(b); assert in.markSupported() : in.getClass().getName(); return URLConnection.guessContentTypeFromStream(in); } catch (final IOException IOE) { reportError(IOE.getMessage(), IOE, ErrorManager.FORMAT_FAILURE); } } return null; //text/plain }
@Override public boolean markSupported() { return stream.markSupported(); }
@Override public boolean markSupported() { return bais.markSupported(); }
@Override public boolean markSupported() { return decryptedResponse.markSupported(); }
@Override public boolean markSupported() { return in.markSupported(); }
@Override public boolean markSupported() { return inputStream.markSupported(); } }
@Override public boolean markSupported() { return bais.markSupported(); }
@Override public boolean markSupported() { return freemarkerProcessedInput.markSupported(); }
public boolean markSupported() { return iStream_.markSupported (); }
@Override public boolean markSupported() { return getByteArrayInputStream().markSupported(); }
@Override public boolean markSupported() { return getByteArrayInputStream().markSupported(); }
@Override public boolean markSupported() { return getByteArrayInputStream().markSupported(); }
@Override public boolean markSupported() { return getByteArrayInputStream().markSupported(); }
@Override public boolean markSupported() { return getByteArrayInputStream().markSupported(); }
/** * Tests if this input stream supports the <code>mark</code> and * <code>reset</code> methods. Whether or not <code>mark</code> and * <code>reset</code> are supported is an invariant property of a * particular input stream instance. The <code>markSupported</code> method * of <code>InputStream</code> returns <code>false</code>. * * @return <code>true</code> if this stream instance supports the mark * and reset methods; <code>false</code> otherwise. * @see java.io.InputStream#mark(int) * @see java.io.InputStream#reset() */ public static boolean isMarkSupported(InputStream is) { ensureIsByteArrayInputStream(is); return ((ByteArrayInputStream) is).markSupported(); }
/** * Tests if this <code>InputStream</code> supports mark/reset. The * <code>markSupported</code> method of <code>ByteArrayInputStream</code> * always returns <code>true</code>. * * @since JDK1.1 */ public boolean markSupported() { lock.lock(); try { check(); return bis.markSupported(); } finally { lock.unlock(); } }
/** * Determines the mimeType of a formatter from the getHead call. * This could be made protected, or a new class could be created to do * this type of conversion. Currently, this is only used for the body * since the attachments are computed by filename. * Package-private for unit testing. * @param chunk any char sequence or null. * @return return the mime type or null for text/plain. */ final String contentTypeOf(CharSequence chunk) { if (!isEmpty(chunk)) { final int MAX_CHARS = 25; if (chunk.length() > MAX_CHARS) { chunk = chunk.subSequence(0, MAX_CHARS); } try { final String charset = getEncodingName(); final byte[] b = chunk.toString().getBytes(charset); final ByteArrayInputStream in = new ByteArrayInputStream(b); assert in.markSupported() : in.getClass().getName(); return URLConnection.guessContentTypeFromStream(in); } catch (final IOException IOE) { reportError(IOE.getMessage(), IOE, ErrorManager.FORMAT_FAILURE); } } return null; //text/plain }
/** * Determines the mimeType of a formatter from the getHead call. * This could be made protected, or a new class could be created to do * this type of conversion. Currently, this is only used for the body * since the attachments are computed by filename. * Package-private for unit testing. * @param chunk any char sequence or null. * @return return the mime type or null for text/plain. */ final String contentTypeOf(CharSequence chunk) { if (!isEmpty(chunk)) { final int MAX_CHARS = 25; if (chunk.length() > MAX_CHARS) { chunk = chunk.subSequence(0, MAX_CHARS); } try { final String charset = getEncodingName(); final byte[] b = chunk.toString().getBytes(charset); final ByteArrayInputStream in = new ByteArrayInputStream(b); assert in.markSupported() : in.getClass().getName(); return URLConnection.guessContentTypeFromStream(in); } catch (final IOException IOE) { reportError(IOE.getMessage(), IOE, ErrorManager.FORMAT_FAILURE); } } return null; //text/plain }