(byte[] buffer, int length)
| 60 | } |
| 61 | |
| 62 | public void append(byte[] buffer, int length){ |
| 63 | byte[] chunk = Arrays.copyOfRange(buffer, 0, length), |
| 64 | reallcd; |
| 65 | int i, j; |
| 66 | |
| 67 | mCharsetDetector.handleData(buffer, 0, length); |
| 68 | |
| 69 | if(mBuffer == null) |
| 70 | mBuffer = chunk; |
| 71 | |
| 72 | else{ |
| 73 | reallcd = new byte[mBuffer.length + length]; |
| 74 | |
| 75 | for(i = 0; i < mBuffer.length; i++) |
| 76 | reallcd[i] = mBuffer[i]; |
| 77 | |
| 78 | for(j = 0; j < length; i++, j++) |
| 79 | reallcd[i] = chunk[j]; |
| 80 | |
| 81 | mBuffer = reallcd; |
| 82 | } |
| 83 | |
| 84 | } |
| 85 | |
| 86 | public int indexOf(byte[] pattern, int start){ |
| 87 | int i, j, plen = pattern.length, stop = mBuffer.length - plen; |
no outgoing calls
no test coverage detected