Java Encode encodeTagChar(char c, Appendable buffer)

Here you can find the source of encodeTagChar(char c, Appendable buffer)

Description

encode a char in TSDB format and append it to a buffer

License

Open Source License

Exception

Parameter Description
IOException an exception

Declaration

private static void encodeTagChar(char c, Appendable buffer) throws IOException 

Method Source Code


//package com.java2s;
//License from project: GNU General Public License 

import java.io.IOException;

public class Main {
    /** encode a char in TSDB format and append it to a buffer 
     * @throws IOException *//*w ww .  ja va  2 s  .c  o  m*/
    private static void encodeTagChar(char c, Appendable buffer) throws IOException {
        String hex = Integer.toHexString(c);
        buffer.append('-');
        for (int len = hex.length(); len < 4; len++) {
            buffer.append('0');
        }
        buffer.append(hex);
    }
}

Related

  1. encodePersonal( InternetAddress[] addresses)
  2. encodeQP(String text)
  3. encodeResult(final Object result)
  4. encodeRGBAsGrayScale(final byte[] raw, final int width, final int height, final int bitsPerPixel, final OutputStream out)
  5. encodeStringBase64(String str)
  6. encodeToTargetEncoding(String text, String sourceEncoding, String targetEncoding)
  7. encodeUint(OutputStream out, final long value)
  8. encodeUInt32(int value, OutputStream out)
  9. encodeUnknownString(String in, OutputStream os)