List of utility methods to do Convert via ByteBuffer
void | toArray(IntBuffer src, int[] dst, int offset) to Array src.position(0); src.get(dst, offset, dst.length - offset); |
byte[] | toArray(long length) to Array long value = length; byte[] b = new byte[8]; for (int i = 7; i >= 0 && value > 0; i--) { b[i] = (byte) (value & 0xFF); value >>= 8; return b; |
byte[] | toASCII(String str) to ASCII try { return str.getBytes("US-ASCII"); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); |
ByteBuffer | toAsciiBytes(String s) to Ascii Bytes return put(ByteBuffer.allocate(s.length()), s);
|
String | toASCIIString(URI u) Returns the content of this URI as a US-ASCII string. String s = defineString(u);
return encode(s);
|
AttributeValue | toAttributeValue(Object value) Copied from DynamoDB Document SDK InternalUtils.java Converts a simple value into the low-level
|
BigDecimal | toBigDecimal(byte[] bytes, int scale) to Big Decimal return new BigDecimal(toBigInteger(bytes), scale); |
BigInteger | toBigInteger(byte[] bytes) to Big Integer return new BigInteger(bytes); |
byte[] | toBinaryFloatingPoint(double source) to Binary Floating Point byte[] res = new byte[8]; ByteBuffer.wrap(res).putDouble(source); return res; |
String | toBinaryString(byte[] b) to Binary String String o = ""; for (int i = 0; i < b.length; i++) { o += hexbin[((b[i] & 255) >>> 4)] + hexbin[(b[i] & 15)]; return o; |