public static String formatByte(byte b) { if (b == Byte.MAX_VALUE) { return "Byte.MAX_VALUE"; } if (b == Byte.MIN_VALUE) { return "Byte.MIN_VALUE"; } return "(byte) " + Byte.toString(b); }
/** * Helper method called by {@link #toString()} in order to convert a single map key into a string. * This is protected to allow subclasses to override the appearance of a given key. */ protected String keyToString(byte key) { return Byte.toString(key); }
/** * Represents the supplied {@code boolean} value as a {@link String}. * * @param value The {@code boolean} value to render. * @return An appropriate {@link String} representation. */ public String toSourceString(byte value) { return Byte.toString(value); }
/** * Helper method called by {@link #toString()} in order to convert a single map key into a string. * This is protected to allow subclasses to override the appearance of a given key. */ protected String keyToString(byte key) { return Byte.toString(key); }
@Override public String prettyPrint() { return Byte.toString( value ); }
@Override public String toString(Byte value) { return value == null ? null : value.toString(); } @Override
/** * Returns the string representation of the specified Byte. * * @param b * The Byte to represent as a string. * * @return The string representation of the specified Byte. */ public static String fromByte(Byte b) { return Byte.toString(b); }
@Override public void setByte(Text text, Byte value) { text.set(value.toString().getBytes(UTF_8)); }
public void arrayb(byte... vargs) { s = ""; if (vargs != null) { s = ""; for (Byte v: vargs) { this.s += Byte.toString(v); } } }
@Override public String convertToString(Byte value) { Preconditions.checkNotNull(value, "'value' must not be null!"); return value.toString(); } };
/** * Appends byte value. */ public StringBand append(byte b) { return append(Byte.toString(b)); }
/** * Obtains the string representation of this object. */ public String toString() { return Byte.toString(getValue()); }
public String setByte() throws Exception { Method m = Field.class.getMethod("setByte", Object.class, Byte.TYPE); Field f = JLRFSetTheRest.class.getDeclaredField("b"); m.invoke(f, this, (byte) 123); return Byte.toString(b); }
/** * Asserts that two arrays contain the same elements in the same order. If they do not, * an AssertionError, with the given message, is thrown. * * @param actual the actual value * @param expected the expected value * @param message the assertion error message */ public static void assertEquals(byte[] actual, byte[] expected, String message) { if (checkRefEqualityAndLength(actual, expected, message)) return; for (int i = 0; i < expected.length; i++) { if (expected[i] != actual[i]) { fail(String.format(ARRAY_MISMATCH_TEMPLATE, i, Byte.toString(expected[i]), Byte.toString(actual[i]), message)); } } }
@Override public void writeInteger( byte value ) { append( Byte.toString( value ) ); }
/** * Appends byte value. */ public StringBand append(final byte b) { return append(Byte.toString(b)); }
public void writeByte(byte b, String tag) throws IOException { printBeginEnvelope(tag); stream.print("<ex:i1>"); stream.print(Byte.toString(b)); stream.print("</ex:i1>"); printEndEnvelope(tag); }
/** * Returns the Byte value for the given key. If the key does not exists it will return the default value given. * The method fails if the value is not a Byte. */ public byte getByte(String key, byte defaultValue) { addToDefaults(key, Byte.toString(defaultValue)); String value = get(key); if (value == null) { return defaultValue; } else { return Byte.valueOf(value); } }
@Override public void setByte(int parameterIndex, byte x) throws SQLException { checkOpen(); setParameter(parameterIndex, formatLiteral("TINYINT", Byte.toString(x))); }
@Override public void writeByteArray( byte[] value ) { String sep = ""; append( "[" ); for ( byte b : value ) { append( sep ); append( Byte.toString( b ) ); sep = ", "; } append( "]" ); }