com.amazonaws.util
Class BinaryUtils

java.lang.Object
  extended by com.amazonaws.util.BinaryUtils

public class BinaryUtils
extends java.lang.Object

Utilities for encoding and decoding binary data to and from different forms.


Constructor Summary
BinaryUtils()
           
 
Method Summary
static byte[] fromBase64(java.lang.String b64Data)
          Converts a Base64-encoded string to the original byte data.
static byte[] fromHex(java.lang.String hexData)
          Converts a Hex-encoded data string to the original byte data.
static java.lang.String toBase64(byte[] data)
          Converts byte data to a Base64-encoded string.
static java.lang.String toHex(byte[] data)
          Converts byte data to a Hex-encoded string.
static java.io.InputStream toStream(java.nio.ByteBuffer byteBuffer)
          Wraps a ByteBuffer in an InputStream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinaryUtils

public BinaryUtils()
Method Detail

toHex

public static java.lang.String toHex(byte[] data)
Converts byte data to a Hex-encoded string.

Parameters:
data - data to hex encode.
Returns:
hex-encoded string.

fromHex

public static byte[] fromHex(java.lang.String hexData)
Converts a Hex-encoded data string to the original byte data.

Parameters:
hexData - hex-encoded data to decode.
Returns:
decoded data from the hex string.

toBase64

public static java.lang.String toBase64(byte[] data)
Converts byte data to a Base64-encoded string.

Parameters:
data - data to Base64 encode.
Returns:
encoded Base64 string.

fromBase64

public static byte[] fromBase64(java.lang.String b64Data)
Converts a Base64-encoded string to the original byte data.

Parameters:
b64Data - a Base64-encoded string to decode.
Returns:
bytes decoded from a Base64 string.

toStream

public static java.io.InputStream toStream(java.nio.ByteBuffer byteBuffer)
Wraps a ByteBuffer in an InputStream.

Parameters:
byteBuffer - The ByteBuffer to wrap.
Returns:
An InputStream wrapping the ByteBuffer content.


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.