1 package org.codehaus.aspectwerkz.util; 2 3 50 public class Base64 { 51 52 53 54 55 58 public final static int NO_OPTIONS = 0; 59 60 63 public final static int ENCODE = 1; 64 65 66 69 public final static int DECODE = 0; 70 71 72 75 public final static int GZIP = 2; 76 77 78 81 public final static int DONT_BREAK_LINES = 8; 82 83 84 85 86 87 90 private final static int MAX_LINE_LENGTH = 76; 91 92 93 96 private final static byte EQUALS_SIGN = (byte) '='; 97 98 99 102 private final static byte NEW_LINE = (byte) '\n'; 103 104 105 108 private final static String PREFERRED_ENCODING = "UTF-8"; 109 110 111 114 private final static byte[] ALPHABET; 115 private final static byte[] _NATIVE_ALPHABET = 116 { 117 (byte) 'A', (byte) 'B', (byte) 'C', (byte) 'D', (byte) 'E', (byte) 'F', (byte) 'G', 118 (byte) 'H', (byte) 'I', (byte) 'J', (byte) 'K', (byte) 'L', (byte) 'M', (byte) 'N', 119 (byte) 'O', (byte) 'P', (byte) 'Q', (byte) 'R', (byte) 'S', (byte) 'T', (byte) 'U', 120 (byte) 'V', (byte) 'W', (byte) 'X', (byte) 'Y', (byte) 'Z', 121 (byte) 'a', (byte) 'b', (byte) 'c', (byte) 'd', (byte) 'e', (byte) 'f', (byte) 'g', 122 (byte) 'h', (byte) 'i', (byte) 'j', (byte) 'k', (byte) 'l', (byte) 'm', (byte) 'n', 123 (byte) 'o', (byte) 'p', (byte) 'q', (byte) 'r', (byte) 's', (byte) 't', (byte) 'u', 124 (byte) 'v', (byte) 'w', (byte) 'x', (byte) 'y', (byte) 'z', 125 (byte) '0', (byte) '1', (byte) '2', (byte) '3', (byte) '4', (byte) '5', 126 (byte) '6', (byte) '7', (byte) '8', (byte) '9', (byte) '+', (byte) '/' 127 }; 128 129 130 static { 131 byte[] __bytes; 132 try { 133 __bytes = 134 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".getBytes(PREFERRED_ENCODING); 135 } catch (java.io.UnsupportedEncodingException use) { 137 __bytes = _NATIVE_ALPHABET; } ALPHABET = __bytes; 140 } 142 143 147 private final static byte[] DECODABET = 148 { 149 -9, -9, -9, -9, -9, -9, -9, -9, -9, -5, -5, -9, -9, -5, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -5, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, 62, -9, -9, -9, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -9, -9, -9, -1, -9, -9, -9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -9, -9, -9, -9, -9, -9, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -9, -9, -9, -9 180 }; 181 182 private final static byte WHITE_SPACE_ENC = -5; private final static byte EQUALS_SIGN_ENC = -1; 187 188 191 private Base64() { 192 } 193 194 195 196 197 198 199 214 private static byte[] encode3to4(byte[] b4, byte[] threeBytes, int numSigBytes) { 215 encode3to4(threeBytes, 0, numSigBytes, b4, 0); 216 return b4; 217 } 219 220 241 private static byte[] encode3to4(byte[] source, int srcOffset, int numSigBytes, 242 byte[] destination, int destOffset) { 243 250 int inBuff = (numSigBytes > 0 ? ((source[srcOffset] << 24) >>> 8) : 0) 255 | (numSigBytes > 1 ? ((source[srcOffset + 1] << 24) >>> 16) : 0) 256 | (numSigBytes > 2 ? ((source[srcOffset + 2] << 24) >>> 24) : 0); 257 258 switch (numSigBytes) { 259 case 3: 260 destination[destOffset] = ALPHABET[(inBuff >>> 18)]; 261 destination[destOffset + 1] = ALPHABET[(inBuff >>> 12) & 0x3f]; 262 destination[destOffset + 2] = ALPHABET[(inBuff >>> 6) & 0x3f]; 263 destination[destOffset + 3] = ALPHABET[(inBuff) & 0x3f]; 264 return destination; 265 266 case 2: 267 destination[destOffset] = ALPHABET[(inBuff >>> 18)]; 268 destination[destOffset + 1] = ALPHABET[(inBuff >>> 12) & 0x3f]; 269 destination[destOffset + 2] = ALPHABET[(inBuff >>> 6) & 0x3f]; 270 destination[destOffset + 3] = EQUALS_SIGN; 271 return destination; 272 273 case 1: 274 destination[destOffset] = ALPHABET[(inBuff >>> 18)]; 275 destination[destOffset + 1] = ALPHABET[(inBuff >>> 12) & 0x3f]; 276 destination[destOffset + 2] = EQUALS_SIGN; 277 destination[destOffset + 3] = EQUALS_SIGN; 278 return destination; 279 280 default: 281 return destination; 282 } } 285 286 297 public static String encodeObject(java.io.Serializable serializableObject) { 298 return encodeObject(serializableObject, NO_OPTIONS); 299 } 301 302 325 public static String encodeObject(java.io.Serializable serializableObject, int options) { 326 java.io.ByteArrayOutputStream baos = null; 328 java.io.OutputStream b64os = null; 329 java.io.ObjectOutputStream oos = null; 330 java.util.zip.GZIPOutputStream gzos = null; 331 332 int gzip = (options & GZIP); 334 int dontBreakLines = (options & DONT_BREAK_LINES); 335 336 try { 337 baos = new java.io.ByteArrayOutputStream (); 339 b64os = new Base64.OutputStream(baos, ENCODE | dontBreakLines); 340 341 if (gzip == GZIP) { 343 gzos = new java.util.zip.GZIPOutputStream (b64os); 344 oos = new java.io.ObjectOutputStream (gzos); 345 } else { 347 oos = new java.io.ObjectOutputStream (b64os); 348 } 349 350 oos.writeObject(serializableObject); 351 } catch (java.io.IOException e) { 353 e.printStackTrace(); 354 return null; 355 } finally { 357 try { 358 oos.close(); 359 } catch (Exception e) { 360 } 361 try { 362 gzos.close(); 363 } catch (Exception e) { 364 } 365 try { 366 b64os.close(); 367 } catch (Exception e) { 368 } 369 try { 370 baos.close(); 371 } catch (Exception e) { 372 } 373 } 375 try { 377 return new String (baos.toByteArray(), PREFERRED_ENCODING); 378 } catch (java.io.UnsupportedEncodingException uue) { 380 return new String (baos.toByteArray()); 381 } 383 } 385 386 393 public static String encodeBytes(byte[] source) { 394 return encodeBytes(source, 0, source.length, NO_OPTIONS); 395 } 397 398 417 public static String encodeBytes(byte[] source, int options) { 418 return encodeBytes(source, 0, source.length, options); 419 } 421 422 431 public static String encodeBytes(byte[] source, int off, int len) { 432 return encodeBytes(source, off, len, NO_OPTIONS); 433 } 435 436 457 public static String encodeBytes(byte[] source, int off, int len, int options) { 458 int dontBreakLines = (options & DONT_BREAK_LINES); 460 int gzip = (options & GZIP); 461 462 if (gzip == GZIP) { 464 java.io.ByteArrayOutputStream baos = null; 465 java.util.zip.GZIPOutputStream gzos = null; 466 Base64.OutputStream b64os = null; 467 468 469 try { 470 baos = new java.io.ByteArrayOutputStream (); 472 b64os = new Base64.OutputStream(baos, ENCODE | dontBreakLines); 473 gzos = new java.util.zip.GZIPOutputStream (b64os); 474 475 gzos.write(source, off, len); 476 gzos.close(); 477 } catch (java.io.IOException e) { 479 e.printStackTrace(); 480 return null; 481 } finally { 483 try { 484 gzos.close(); 485 } catch (Exception e) { 486 } 487 try { 488 b64os.close(); 489 } catch (Exception e) { 490 } 491 try { 492 baos.close(); 493 } catch (Exception e) { 494 } 495 } 497 try { 499 return new String (baos.toByteArray(), PREFERRED_ENCODING); 500 } catch (java.io.UnsupportedEncodingException uue) { 502 return new String (baos.toByteArray()); 503 } } 506 else { 508 boolean breakLines = dontBreakLines == 0; 510 511 int len43 = len * 4 / 3; 512 byte[] outBuff = new byte[(len43) + ((len % 3) > 0 ? 4 : 0) + (breakLines ? (len43 / MAX_LINE_LENGTH) : 0)]; int d = 0; 516 int e = 0; 517 int len2 = len - 2; 518 int lineLength = 0; 519 for (; d < len2; d += 3, e += 4) { 520 encode3to4(source, d + off, 3, outBuff, e); 521 522 lineLength += 4; 523 if (breakLines && lineLength == MAX_LINE_LENGTH) { 524 outBuff[e + 4] = NEW_LINE; 525 e++; 526 lineLength = 0; 527 } } 530 if (d < len) { 531 encode3to4(source, d + off, len - d, outBuff, e); 532 e += 4; 533 } 535 536 try { 538 return new String (outBuff, 0, e, PREFERRED_ENCODING); 539 } catch (java.io.UnsupportedEncodingException uue) { 541 return new String (outBuff, 0, e); 542 } 544 } 546 } 548 549 550 551 552 553 554 555 576 private static int decode4to3(byte[] source, int srcOffset, byte[] destination, int destOffset) { 577 if (source[srcOffset + 2] == EQUALS_SIGN) { 579 int outBuff = ((DECODABET[source[srcOffset]] & 0xFF) << 18) 583 | ((DECODABET[source[srcOffset + 1]] & 0xFF) << 12); 584 585 destination[destOffset] = (byte) (outBuff >>> 16); 586 return 1; 587 } 588 589 else if (source[srcOffset + 3] == EQUALS_SIGN) { 591 int outBuff = ((DECODABET[source[srcOffset]] & 0xFF) << 18) 596 | ((DECODABET[source[srcOffset + 1]] & 0xFF) << 12) 597 | ((DECODABET[source[srcOffset + 2]] & 0xFF) << 6); 598 599 destination[destOffset] = (byte) (outBuff >>> 16); 600 destination[destOffset + 1] = (byte) (outBuff >>> 8); 601 return 2; 602 } 603 604 else { 606 try { 607 int outBuff = ((DECODABET[source[srcOffset]] & 0xFF) << 18) 613 | ((DECODABET[source[srcOffset + 1]] & 0xFF) << 12) 614 | ((DECODABET[source[srcOffset + 2]] & 0xFF) << 6) 615 | ((DECODABET[source[srcOffset + 3]] & 0xFF)); 616 617 618 destination[destOffset] = (byte) (outBuff >> 16); 619 destination[destOffset + 1] = (byte) (outBuff >> 8); 620 destination[destOffset + 2] = (byte) (outBuff); 621 622 return 3; 623 } catch (Exception e) { 624 System.out.println("" + source[srcOffset] + ": " + (DECODABET[source[srcOffset]])); 625 System.out.println("" + source[srcOffset + 1] + ": " + (DECODABET[source[srcOffset + 1]])); 626 System.out.println("" + source[srcOffset + 2] + ": " + (DECODABET[source[srcOffset + 2]])); 627 System.out.println("" + source[srcOffset + 3] + ": " + (DECODABET[source[srcOffset + 3]])); 628 return -1; 629 } } 631 } 633 634 645 public static byte[] decode(byte[] source, int off, int len) { 646 int len34 = len * 3 / 4; 647 byte[] outBuff = new byte[len34]; int outBuffPosn = 0; 649 650 byte[] b4 = new byte[4]; 651 int b4Posn = 0; 652 int i = 0; 653 byte sbiCrop = 0; 654 byte sbiDecode = 0; 655 for (i = off; i < off + len; i++) { 656 sbiCrop = (byte) (source[i] & 0x7f); sbiDecode = DECODABET[sbiCrop]; 658 659 if (sbiDecode >= WHITE_SPACE_ENC) { 661 if (sbiDecode >= EQUALS_SIGN_ENC) { 662 b4[b4Posn++] = sbiCrop; 663 if (b4Posn > 3) { 664 outBuffPosn += decode4to3(b4, 0, outBuff, outBuffPosn); 665 b4Posn = 0; 666 667 if (sbiCrop == EQUALS_SIGN) { 669 break; 670 } 671 } 673 } 675 } else { 677 System.err.println("Bad Base64 input character at " + i + ": " + source[i] + "(decimal)"); 678 return null; 679 } } 682 byte[] out = new byte[outBuffPosn]; 683 System.arraycopy(outBuff, 0, out, 0, outBuffPosn); 684 return out; 685 } 687 688 696 public static byte[] decode(String s) { 697 byte[] bytes; 698 try { 699 bytes = s.getBytes(PREFERRED_ENCODING); 700 } catch (java.io.UnsupportedEncodingException uee) { 702 bytes = s.getBytes(); 703 } 706 bytes = decode(bytes, 0, bytes.length); 708 709 710 if (bytes != null && bytes.length >= 4) { 713 714 int head = ((int) bytes[0] & 0xff) | ((bytes[1] << 8) & 0xff00); 715 if (java.util.zip.GZIPInputStream.GZIP_MAGIC == head) { 716 java.io.ByteArrayInputStream bais = null; 717 java.util.zip.GZIPInputStream gzis = null; 718 java.io.ByteArrayOutputStream baos = null; 719 byte[] buffer = new byte[2048]; 720 int length = 0; 721 722 try { 723 baos = new java.io.ByteArrayOutputStream (); 724 bais = new java.io.ByteArrayInputStream (bytes); 725 gzis = new java.util.zip.GZIPInputStream (bais); 726 727 while ((length = gzis.read(buffer)) >= 0) { 728 baos.write(buffer, 0, length); 729 } 731 bytes = baos.toByteArray(); 733 734 } catch (java.io.IOException e) { 736 } finally { 739 try { 740 baos.close(); 741 } catch (Exception e) { 742 } 743 try { 744 gzis.close(); 745 } catch (Exception e) { 746 } 747 try { 748 bais.close(); 749 } catch (Exception e) { 750 } 751 } 753 } } 756 return bytes; 757 } 759 760 768 public static Object decodeToObject(String encodedObject) { 769 byte[] objBytes = decode(encodedObject); 771 772 java.io.ByteArrayInputStream bais = null; 773 java.io.ObjectInputStream ois = null; 774 Object obj = null; 775 776 try { 777 bais = new java.io.ByteArrayInputStream (objBytes); 778 ois = new java.io.ObjectInputStream (bais); 779 780 obj = ois.readObject(); 781 } catch (java.io.IOException e) { 783 e.printStackTrace(); 784 obj = null; 785 } catch (java.lang.ClassNotFoundException e) { 787 e.printStackTrace(); 788 obj = null; 789 } finally { 791 try { 792 bais.close(); 793 } catch (Exception e) { 794 } 795 try { 796 ois.close(); 797 } catch (Exception e) { 798 } 799 } 801 return obj; 802 } 804 805 813 public static boolean encodeToFile(byte[] dataToEncode, String filename) { 814 boolean success = false; 815 Base64.OutputStream bos = null; 816 try { 817 bos = new Base64.OutputStream(new java.io.FileOutputStream (filename), Base64.ENCODE); 818 bos.write(dataToEncode); 819 success = true; 820 } catch (java.io.IOException e) { 822 823 success = false; 824 } finally { 826 try { 827 bos.close(); 828 } catch (Exception e) { 829 } 830 } 832 return success; 833 } 835 836 844 public static boolean decodeToFile(String dataToDecode, String filename) { 845 boolean success = false; 846 Base64.OutputStream bos = null; 847 try { 848 bos = new Base64.OutputStream(new java.io.FileOutputStream (filename), Base64.DECODE); 849 bos.write(dataToDecode.getBytes(PREFERRED_ENCODING)); 850 success = true; 851 } catch (java.io.IOException e) { 853 success = false; 854 } finally { 856 try { 857 bos.close(); 858 } catch (Exception e) { 859 } 860 } 862 return success; 863 } 865 866 874 public static byte[] decodeFromFile(String filename) { 875 byte[] decodedData = null; 876 Base64.InputStream bis = null; 877 try { 878 java.io.File file = new java.io.File (filename); 880 byte[] buffer = null; 881 int length = 0; 882 int numBytes = 0; 883 884 if (file.length() > Integer.MAX_VALUE) { 886 System.err.println("File is too big for this convenience method (" + file.length() + " bytes)."); 887 return null; 888 } buffer = new byte[(int) file.length()]; 890 891 bis = new Base64.InputStream( 893 new java.io.BufferedInputStream (new java.io.FileInputStream (file)), Base64.DECODE 894 ); 895 896 while ((numBytes = bis.read(buffer, length, 4096)) >= 0) { 898 length += numBytes; 899 } 900 901 decodedData = new byte[length]; 903 System.arraycopy(buffer, 0, decodedData, 0, length); 904 905 } catch (java.io.IOException e) { 907 System.err.println("Error decoding from file " + filename); 908 } finally { 910 try { 911 bis.close(); 912 } catch (Exception e) { 913 } 914 } 916 return decodedData; 917 } 919 920 928 public static String encodeFromFile(String filename) { 929 String encodedData = null; 930 Base64.InputStream bis = null; 931 try { 932 java.io.File file = new java.io.File (filename); 934 byte[] buffer = new byte[(int) (file.length() * 1.4)]; 935 int length = 0; 936 int numBytes = 0; 937 938 bis = new Base64.InputStream( 940 new java.io.BufferedInputStream (new java.io.FileInputStream (file)), Base64.ENCODE 941 ); 942 943 while ((numBytes = bis.read(buffer, length, 4096)) >= 0) { 945 length += numBytes; 946 } 947 948 encodedData = new String (buffer, 0, length, Base64.PREFERRED_ENCODING); 950 951 } catch (java.io.IOException e) { 953 System.err.println("Error encoding from file " + filename); 954 } finally { 956 try { 957 bis.close(); 958 } catch (Exception e) { 959 } 960 } 962 return encodedData; 963 } 965 966 967 968 969 970 971 972 980 public static class InputStream extends java.io.FilterInputStream { 981 private boolean encode; private int position; private byte[] buffer; private int bufferLength; private int numSigBytes; private int lineLength; 987 private boolean breakLines; 989 990 996 public InputStream(java.io.InputStream in) { 997 this(in, DECODE); 998 } 1000 1001 1021 public InputStream(java.io.InputStream in, int options) { 1022 super(in); 1023 this.breakLines = (options & DONT_BREAK_LINES) != DONT_BREAK_LINES; 1024 this.encode = (options & ENCODE) == ENCODE; 1025 this.bufferLength = encode ? 4 : 3; 1026 this.buffer = new byte[bufferLength]; 1027 this.position = -1; 1028 this.lineLength = 0; 1029 } 1031 1038 public int read() throws java.io.IOException { 1039 if (position < 0) { 1041 if (encode) { 1042 byte[] b3 = new byte[3]; 1043 int numBinaryBytes = 0; 1044 for (int i = 0; i < 3; i++) { 1045 try { 1046 int b = in.read(); 1047 1048 if (b >= 0) { 1050 b3[i] = (byte) b; 1051 numBinaryBytes++; 1052 } 1054 } catch (java.io.IOException e) { 1056 if (i == 0) { 1058 throw e; 1059 } 1060 1061 } } 1064 if (numBinaryBytes > 0) { 1065 encode3to4(b3, 0, numBinaryBytes, buffer, 0); 1066 position = 0; 1067 numSigBytes = 4; 1068 } else { 1070 return -1; 1071 } } 1074 else { 1076 byte[] b4 = new byte[4]; 1077 int i = 0; 1078 for (i = 0; i < 4; i++) { 1079 int b = 0; 1081 do { 1082 b = in.read(); 1083 } while (b >= 0 && DECODABET[b & 0x7f] <= WHITE_SPACE_ENC); 1084 1085 if (b < 0) { 1086 break; } 1088 1089 b4[i] = (byte) b; 1090 } 1092 if (i == 4) { 1093 numSigBytes = decode4to3(b4, 0, buffer, 0); 1094 position = 0; 1095 } else if (i == 0) { 1097 return -1; 1098 } else { 1100 throw new java.io.IOException ("Improperly padded Base64 input."); 1102 } 1104 } } 1107 if (position >= 0) { 1109 if ( position >= numSigBytes) { 1111 return -1; 1112 } 1113 1114 if (encode && breakLines && lineLength >= MAX_LINE_LENGTH) { 1115 lineLength = 0; 1116 return '\n'; 1117 } else { 1119 lineLength++; 1123 int b = buffer[position++]; 1124 1125 if (position >= bufferLength) { 1126 position = -1; 1127 } 1128 1129 return b & 0xFF; } } 1134 else { 1136 throw new java.io.IOException ("Error in Base64 code reading stream."); 1138 } } 1141 1142 1154 public int read(byte[] dest, int off, int len) throws java.io.IOException { 1155 int i; 1156 int b; 1157 for (i = 0; i < len; i++) { 1158 b = read(); 1159 1160 1163 if (b >= 0) { 1164 dest[off + i] = (byte) b; 1165 } else if (i == 0) { 1166 return -1; 1167 } else { 1168 break; } 1170 } return i; 1172 } 1174 } 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1193 public static class OutputStream extends java.io.FilterOutputStream { 1194 private boolean encode; 1195 private int position; 1196 private byte[] buffer; 1197 private int bufferLength; 1198 private int lineLength; 1199 private boolean breakLines; 1200 private byte[] b4; private boolean suspendEncoding; 1202 1203 1209 public OutputStream(java.io.OutputStream out) { 1210 this(out, ENCODE); 1211 } 1213 1214 1234 public OutputStream(java.io.OutputStream out, int options) { 1235 super(out); 1236 this.breakLines = (options & DONT_BREAK_LINES) != DONT_BREAK_LINES; 1237 this.encode = (options & ENCODE) == ENCODE; 1238 this.bufferLength = encode ? 3 : 4; 1239 this.buffer = new byte[bufferLength]; 1240 this.position = 0; 1241 this.lineLength = 0; 1242 this.suspendEncoding = false; 1243 this.b4 = new byte[4]; 1244 } 1246 1247 1259 public void write(int theByte) throws java.io.IOException { 1260 if (suspendEncoding) { 1262 super.out.write(theByte); 1263 return; 1264 } 1266 if (encode) { 1268 buffer[position++] = (byte) theByte; 1269 if (position >= bufferLength) { 1271 out.write(encode3to4(b4, buffer, bufferLength)); 1272 1273 lineLength += 4; 1274 if (breakLines && lineLength >= MAX_LINE_LENGTH) { 1275 out.write(NEW_LINE); 1276 lineLength = 0; 1277 } 1279 position = 0; 1280 } } 1283 else { 1285 if (DECODABET[theByte & 0x7f] > WHITE_SPACE_ENC) { 1287 buffer[position++] = (byte) theByte; 1288 if (position >= bufferLength) { 1290 int len = Base64.decode4to3(buffer, 0, b4, 0); 1291 out.write(b4, 0, len); 1292 position = 0; 1294 } } else if (DECODABET[theByte & 0x7f] != WHITE_SPACE_ENC) { 1297 throw new java.io.IOException ("Invalid character in Base64 data."); 1298 } } } 1302 1303 1312 public void write(byte[] theBytes, int off, int len) throws java.io.IOException { 1313 if (suspendEncoding) { 1315 super.out.write(theBytes, off, len); 1316 return; 1317 } 1319 for (int i = 0; i < len; i++) { 1320 write(theBytes[off + i]); 1321 } 1323 } 1325 1326 1330 public void flushBase64() throws java.io.IOException { 1331 if (position > 0) { 1332 if (encode) { 1333 out.write(encode3to4(b4, buffer, position)); 1334 position = 0; 1335 } else { 1337 throw new java.io.IOException ("Base64 input not properly padded."); 1338 } } 1341 } 1343 1344 1349 public void close() throws java.io.IOException { 1350 flushBase64(); 1352 1353 super.close(); 1356 1357 buffer = null; 1358 out = null; 1359 } 1361 1362 1369 public void suspendEncoding() throws java.io.IOException { 1370 flushBase64(); 1371 this.suspendEncoding = true; 1372 } 1374 1375 1382 public void resumeEncoding() { 1383 this.suspendEncoding = false; 1384 } 1386 1387 } 1389 1390} | Popular Tags |