Example usage for org.apache.http.util EncodingUtils getAsciiBytes

List of usage examples for org.apache.http.util EncodingUtils getAsciiBytes

Introduction

In this page you can find the example usage for org.apache.http.util EncodingUtils getAsciiBytes.

Prototype

public static byte[] getAsciiBytes(String str) 

Source Link

Usage

From source file:com.android.internal.http.multipart.Part.java

/**
 * Write the content disposition header to the specified output stream
 * //from   w  ww.  j a v  a2  s .  c om
 * @param out The output stream
 * @throws IOException If an IO problem occurs.
 */
protected void sendDispositionHeader(OutputStream out) throws IOException {
    LOG.trace("enter sendDispositionHeader(OutputStream out)");
    out.write(CONTENT_DISPOSITION_BYTES);
    out.write(QUOTE_BYTES);
    out.write(EncodingUtils.getAsciiBytes(getName()));
    out.write(QUOTE_BYTES);
}

From source file:com.chanapps.four.multipartmime.Part.java

/**
 * Write the content disposition header to the specified output stream
 * /*from   w ww.j a  v a 2 s.co m*/
 * @param out The output stream
 * @throws IOException If an IO problem occurs.
 */
protected void sendDispositionHeader(OutputStream out) throws IOException {
    if (DEBUG)
        Log.d(TAG, "enter sendDispositionHeader(OutputStream out)");
    out.write(CONTENT_DISPOSITION_BYTES);
    out.write(QUOTE_BYTES);
    out.write(EncodingUtils.getAsciiBytes(getName()));
    out.write(QUOTE_BYTES);
}

From source file:com.android.internalcopy.http.multipart.Part.java

/**
 * Write the content type header to the specified output stream
 * @param out The output stream/*from  www.  java  2s  . com*/
 * @throws IOException If an IO problem occurs.
 */
protected void sendContentTypeHeader(OutputStream out) throws IOException {
    String contentType = getContentType();
    if (contentType != null) {
        out.write(CRLF_BYTES);
        out.write(CONTENT_TYPE_BYTES);
        out.write(EncodingUtils.getAsciiBytes(contentType));
        String charSet = getCharSet();
        if (charSet != null) {
            out.write(CHARSET_BYTES);
            out.write(EncodingUtils.getAsciiBytes(charSet));
        }
    }
}

From source file:com.nhn.android.me2day.sample.multipart.Part.java

/**
 * Write the content type header to the specified output stream
 * @param out The output stream//www. j  a  va  2  s  .  c o m
 * @throws IOException If an IO problem occurs.
 */
protected void sendContentTypeHeader(OutputStream out) throws IOException {
    Log.d("Part", "enter sendContentTypeHeader(OutputStream out)");
    String contentType = getContentType();
    if (contentType != null) {
        out.write(CRLF_BYTES);
        out.write(CONTENT_TYPE_BYTES);
        out.write(EncodingUtils.getAsciiBytes(contentType));
        String charSet = getCharSet();
        if (charSet != null) {
            out.write(CHARSET_BYTES);
            out.write(EncodingUtils.getAsciiBytes(charSet));
        }
    }
}

From source file:com.android.internal.http.multipart.Part.java

/**
 * Write the content type header to the specified output stream
 * @param out The output stream//from   ww  w . j  ava 2  s  .  c  o  m
 * @throws IOException If an IO problem occurs.
 */
protected void sendContentTypeHeader(OutputStream out) throws IOException {
    LOG.trace("enter sendContentTypeHeader(OutputStream out)");
    String contentType = getContentType();
    if (contentType != null) {
        out.write(CRLF_BYTES);
        out.write(CONTENT_TYPE_BYTES);
        out.write(EncodingUtils.getAsciiBytes(contentType));
        String charSet = getCharSet();
        if (charSet != null) {
            out.write(CHARSET_BYTES);
            out.write(EncodingUtils.getAsciiBytes(charSet));
        }
    }
}

From source file:com.chanapps.four.multipartmime.Part.java

/**
 * Write the content type header to the specified output stream
 * @param out The output stream/*from w  w  w. j a v a  2s.  c o m*/
 * @throws IOException If an IO problem occurs.
 */
protected void sendContentTypeHeader(OutputStream out) throws IOException {
    if (DEBUG)
        Log.d(TAG, "enter sendContentTypeHeader(OutputStream out)");
    String contentType = getContentType();
    if (contentType != null) {
        out.write(CRLF_BYTES);
        out.write(CONTENT_TYPE_BYTES);
        out.write(EncodingUtils.getAsciiBytes(contentType));
        String charSet = getCharSet();
        if (charSet != null) {
            out.write(CHARSET_BYTES);
            out.write(EncodingUtils.getAsciiBytes(charSet));
        }
    }
}

From source file:com.android.internalcopy.http.multipart.Part.java

/**
 * Write the content transfer encoding header to the specified 
 * output stream/* ww w  .  j  av a2  s.  c o m*/
 * 
 * @param out The output stream
 * @throws IOException If an IO problem occurs.
 */
protected void sendTransferEncodingHeader(OutputStream out) throws IOException {
    String transferEncoding = getTransferEncoding();
    if (transferEncoding != null) {
        out.write(CRLF_BYTES);
        out.write(CONTENT_TRANSFER_ENCODING_BYTES);
        out.write(EncodingUtils.getAsciiBytes(transferEncoding));
    }
}

From source file:com.nhn.android.me2day.sample.multipart.Part.java

/**
 * Write the content transfer encoding header to the specified 
 * output stream/*from   w  ww  . ja  v  a 2  s  . c  om*/
 * 
 * @param out The output stream
 * @throws IOException If an IO problem occurs.
 */
protected void sendTransferEncodingHeader(OutputStream out) throws IOException {
    Log.d("Part", "enter sendTransferEncodingHeader(OutputStream out)");
    String transferEncoding = getTransferEncoding();
    if (transferEncoding != null) {
        out.write(CRLF_BYTES);
        out.write(CONTENT_TRANSFER_ENCODING_BYTES);
        out.write(EncodingUtils.getAsciiBytes(transferEncoding));
    }
}

From source file:com.android.internal.http.multipart.Part.java

/**
 * Write the content transfer encoding header to the specified 
 * output stream/*  ww  w . j a v a  2s .  c om*/
 * 
 * @param out The output stream
 * @throws IOException If an IO problem occurs.
 */
protected void sendTransferEncodingHeader(OutputStream out) throws IOException {
    LOG.trace("enter sendTransferEncodingHeader(OutputStream out)");
    String transferEncoding = getTransferEncoding();
    if (transferEncoding != null) {
        out.write(CRLF_BYTES);
        out.write(CONTENT_TRANSFER_ENCODING_BYTES);
        out.write(EncodingUtils.getAsciiBytes(transferEncoding));
    }
}

From source file:com.chanapps.four.multipartmime.Part.java

/**
 * Write the content transfer encoding header to the specified 
 * output stream//w  ww .ja  v a 2 s.  co  m
 * 
 * @param out The output stream
 * @throws IOException If an IO problem occurs.
 */
protected void sendTransferEncodingHeader(OutputStream out) throws IOException {
    if (DEBUG)
        Log.d(TAG, "enter sendTransferEncodingHeader(OutputStream out)");
    String transferEncoding = getTransferEncoding();
    if (transferEncoding != null) {
        out.write(CRLF_BYTES);
        out.write(CONTENT_TRANSFER_ENCODING_BYTES);
        out.write(EncodingUtils.getAsciiBytes(transferEncoding));
    }
}