public class

EvernoteUtil

extends Object
java.lang.Object
   ↳ com.evernote.client.android.EvernoteUtil

Summary

Constants
String NOTE_PREFIX The ENML preamble to every Evernote note.
String NOTE_SUFFIX The ENML postamble to every Evernote note
Public Constructors
EvernoteUtil()
Public Methods
static String bytesToHex(byte[] bytes, boolean withSpaces)
Takes the provided byte array and converts it into a hexadecimal string with two characters per byte.
static String bytesToHex(byte[] bytes)
Converts the provided byte array into a hexadecimal string with two characters per byte.
static String createEnMediaTag(Resource resource)
Create an ENML <en-media> tag for the specified Resource object.
static byte[] hash(InputStream in)
Returns an MD5 checksum of the contents of the provided InputStream.
static byte[] hash(byte[] body)
Returns an MD5 checksum of the provided array of bytes.
static byte[] hexToBytes(String hexString)
Takes a string in hexadecimal format and converts it to a binary byte array.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String NOTE_PREFIX

The ENML preamble to every Evernote note. Note content goes between and

Constant Value: ""

public static final String NOTE_SUFFIX

The ENML postamble to every Evernote note

Constant Value: ""

Public Constructors

public EvernoteUtil ()

Public Methods

public static String bytesToHex (byte[] bytes, boolean withSpaces)

Takes the provided byte array and converts it into a hexadecimal string with two characters per byte.

Parameters
withSpaces if true, include a space character between each hex-rendered byte for readability.

public static String bytesToHex (byte[] bytes)

Converts the provided byte array into a hexadecimal string with two characters per byte.

public static String createEnMediaTag (Resource resource)

Create an ENML <en-media> tag for the specified Resource object.

public static byte[] hash (InputStream in)

Returns an MD5 checksum of the contents of the provided InputStream.

Throws
IOException

public static byte[] hash (byte[] body)

Returns an MD5 checksum of the provided array of bytes.

public static byte[] hexToBytes (String hexString)

Takes a string in hexadecimal format and converts it to a binary byte array. This does no checking of the format of the input, so this should only be used after confirming the format or origin of the string. The input string should only contain the hex data, two characters per byte.