Buggy code:
; private static final byte PAD = '=' ; private static final byte [ ] DECODE_TABLE = new byte [ ] { - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , 62 , - 1 , 62 , - 1 , 63 , 52 , 53 , 54 , 55 , 56 , 57 , 58 , 59 , 60 , 61 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , 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 , - 1 , - 1 , - 1 , - 1 , 63 , - 1 , 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 } ; private static final int MASK_6BITS = 63 ; private static final int MASK_8BITS = 255 ; private final byte [ ] encodeTable ; private final int lineLength ; private final byte [ ] lineSeparator ; private final int decodeSize ; private final int encodeSize ; private byte [ ] buffer ; private int pos ; private int readPos ; private int currentLinePos ; private int modulus ; private boolean eof ; private int x ; public Base64 ( ) { } public Base64 ( boolean urlSafe ) { } public Base64 ( int lineLength ) { } public Base64 ( int lineLength , byte [ ] lineSeparator ) { } public Base64 ( int lineLength , byte [ ] lineSeparator , boolean urlSafe ) { } public boolean isUrlSafe ( ) { } boolean hasData ( ) { } int avail ( ) { } private void resizeBuffer ( ) { } int readResults ( byte [ ] b , int bPos , int bAvail ) { } void encode ( byte [ ] in , int inPos , int inAvail ) { } void decode ( byte [ ] in , int inPos , int inAvail ) { } public static boolean isBase64 ( byte octet ) { } public static boolean isBase64 ( String base64 ) { } public static boolean isArrayByteBase64 ( byte [ ] arrayOctet ) { } public static boolean isBase64 ( byte [ ] arrayOctet ) { } private static boolean containsBase64Byte ( byte [ ] arrayOctet ) { } public static byte [ ] encodeBase64 ( byte [ ] binaryData ) { } public static String encodeBase64String ( byte [ ] binaryData ) { } public static byte [ ] encodeBase64URLSafe ( byte [ ] binaryData ) { } public static String encodeBase64URLSafeString ( byte [ ] binaryData ) { } public static byte [ ] encodeBase64Chunked ( byte [ ] binaryData ) { } public Object decode ( Object pObject ) throws DecoderException { } public byte [ ] decode ( String pArray ) { } public byte [ ] decode ( byte [ ] pArray ) { } public static byte [ ] encodeBase64 ( byte [ ] binaryData , boolean isChunked ) { } public static byte [ ] encodeBase64 ( byte [ ] binaryData , boolean isChunked , boolean urlSafe ) { } public static byte [ ] encodeBase64 ( byte [ ] binaryData , boolean isChunked , boolean urlSafe , int maxResultSize ) { if ( ( binaryData == null ) || ( ( binaryData . length ) == 0 ) ) { return binaryData ; } <START_BUG> long len = Base64 . getEncodeLength ( binaryData , Base64 . MIME_CHUNK_SIZE , Base64 . CHUNK_SEPARATOR ) ; <END_BUG> if ( len > maxResultSize ) { throw new IllegalArgumentException ( ( ( ( "Input<seq2seq4repair_space>array<seq2seq4repair_space>too<seq2seq4repair_space>big,<seq2seq4repair_space>the<seq2seq4repair_space>output<seq2seq4repair_space>array<seq2seq4repair_space>would<seq2seq4repair_space>be<seq2seq4repair_space>bigger<seq2seq4repair_space>(" + len ) + ")<seq2seq4repair_space>than<seq2seq4repair_space>the<seq2seq4repair_space>specified<seq2seq4repair_space>maxium<seq2seq4repair_space>size<seq2seq4repair_space>of<seq2seq4repair_space>" ) + maxResultSize ) ) ; } Base64 b64 = ( isChunked ) ? new Base64 ( urlSafe ) : new Base64 ( 0 , Base64 . CHUNK_SEPARATOR , urlSafe ) ; return b64 . encode ( binaryData ) ; } public static byte [ ] decodeBase64 ( String base64String ) { } public static byte [ ] decodeBase64 ( byte [ ] base64Data ) { } static byte [ ] discardWhitespace ( byte [ ] data ) { } private static boolean isWhiteSpace ( byte byteToCheck ) { } public Object encode ( Object pObject ) throws EncoderException { } public String encodeToString ( byte [ ] pArray ) { } public byte [ ] encode ( byte [ ] pArray ) { } private static long getEncodeLength ( byte [ ] pArray , int chunkSize , byte [ ] chunkSeparator ) { } public static BigInteger decodeInteger ( byte [ ] pArray ) { } public static byte [ ] encodeInteger ( BigInteger bigInt ) { } static byte [ ] toIntegerBytes ( BigInteger bigInt ) { } private void reset ( ) { } }

Fix:
long len = Base64 . getEncodeLength ( binaryData , ( isChunked ? Base64 . MIME_CHUNK_SIZE : 0 ) , Base64 . CHUNK_SEPARATOR ) ;