Lines Matching refs:buf
766 char[] buf = new char[((len + 2) / 3) * 4];
767 int ptr = _printBase64Binary(input, offset, len, buf, 0);
768 assert ptr == buf.length;
769 return new String(buf);
781 public static int _printBase64Binary(byte[] input, int offset, int len, char[] buf, int ptr) {
786 buf[ptr++] = encode(input[i] >> 2);
787 buf[ptr++] = encode(
790 buf[ptr++] = encode(
793 buf[ptr++] = encode(input[i + 2] & 0x3F);
797 buf[ptr++] = encode(input[i] >> 2);
798 buf[ptr++] = encode(((input[i]) & 0x3) << 4);
799 buf[ptr++] = '=';
800 buf[ptr++] = '=';
804 buf[ptr++] = encode(input[i] >> 2);
805 buf[ptr++] = encode(((input[i] & 0x3) << 4)
807 buf[ptr++] = encode((input[i + 1] & 0xF) << 2);
808 buf[ptr++] = '=';
824 byte[] buf = out;
828 buf[ptr++] = encodeByte(input[i]>>2);
829 buf[ptr++] = encodeByte(
832 buf[ptr++] = encodeByte(
835 buf[ptr++] = encodeByte(input[i+2]&0x3F);
839 buf[ptr++] = encodeByte(input[i]>>2);
840 buf[ptr++] = encodeByte(((input[i])&0x3)<<4);
841 buf[ptr++] = '=';
842 buf[ptr++] = '=';
846 buf[ptr++] = encodeByte(input[i]>>2);
847 buf[ptr++] = encodeByte(
850 buf[ptr++] = encodeByte((input[i+1]&0xF)<<2);
851 buf[ptr++] = '=';
900 StringBuilder buf = new StringBuilder();
906 buf.append(fch);
913 formatYear(cal, buf);
917 formatMonth(cal, buf);
921 formatDays(cal, buf);
925 formatHours(cal, buf);
929 formatMinutes(cal, buf);
933 formatSeconds(cal, buf);
937 formatTimeZone(cal, buf);
946 return buf.toString();
949 private static void formatYear(Calendar cal, StringBuilder buf) {
968 buf.append(s);
971 private static void formatMonth(Calendar cal, StringBuilder buf) {
972 formatTwoDigits(cal.get(Calendar.MONTH) + 1, buf);
975 private static void formatDays(Calendar cal, StringBuilder buf) {
976 formatTwoDigits(cal.get(Calendar.DAY_OF_MONTH), buf);
979 private static void formatHours(Calendar cal, StringBuilder buf) {
980 formatTwoDigits(cal.get(Calendar.HOUR_OF_DAY), buf);
983 private static void formatMinutes(Calendar cal, StringBuilder buf) {
984 formatTwoDigits(cal.get(Calendar.MINUTE), buf);
987 private static void formatSeconds(Calendar cal, StringBuilder buf) {
988 formatTwoDigits(cal.get(Calendar.SECOND), buf);
996 buf.append('.');
997 buf.append(ms);
1003 private static void formatTimeZone(Calendar cal, StringBuilder buf) {
1014 buf.append('Z');
1019 buf.append('+');
1021 buf.append('-');
1027 formatTwoDigits(offset / 60, buf);
1028 buf.append(':');
1029 formatTwoDigits(offset % 60, buf);
1033 private static void formatTwoDigits(int n, StringBuilder buf) {
1036 buf.append('0');
1038 buf.append(n);