{"record":{"id":"51dc32ab4d947c65","repo":"apache/hadoop","slug":"requested-more-bytes-than-destination-buffer-size-51dc32","errorCode":null,"errorMessage":"Requested more bytes than destination buffer size: request length ={length}, with offset ={offset}; buffer capacity ={b.length - offset}","messagePattern":"Requested more bytes than destination buffer size: request length =(.+?), with offset =(.+?); buffer capacity =(.+?)","errorType":"exception","errorClass":"IndexOutOfBoundsException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-aliyun/src/main/java/org/apache/hadoop/fs/aliyun/oss/OSSDataBlocks.java","lineNumber":864,"sourceCode":"        }\n\n        /**\n         * Read in data.\n         * @param b destination buffer\n         * @param offset offset within the buffer\n         * @param length length of bytes to read\n         * @throws EOFException if the position is negative\n         * @throws IndexOutOfBoundsException if there isn't space for the\n         * amount of data requested.\n         * @throws IllegalArgumentException other arguments are invalid.\n         */\n        @SuppressWarnings(\"NullableProblems\")\n        public synchronized int read(byte[] b, int offset, int length)\n            throws IOException {\n          Preconditions.checkArgument(length >= 0, \"length is negative\");\n          Preconditions.checkArgument(b != null, \"Null buffer\");\n          if (b.length - offset < length) {\n            throw new IndexOutOfBoundsException(\n                FSExceptionMessages.TOO_MANY_BYTES_FOR_DEST_BUFFER\n                    + \": request length =\" + length\n                    + \", with offset =\" + offset\n                    + \"; buffer capacity =\" + (b.length - offset));\n          }\n          verifyOpen();\n          if (!hasRemaining()) {\n            return -1;\n          }\n\n          int toRead = Math.min(length, available());\n          byteBuffer.get(b, offset, toRead);\n          return toRead;\n        }\n\n        @Override\n        public String toString() {\n          final StringBuilder sb = new StringBuilder(","sourceCodeStart":846,"sourceCodeEnd":882,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-aliyun/src/main/java/org/apache/hadoop/fs/aliyun/oss/OSSDataBlocks.java#L846-L882","documentation":"Error \"Requested more bytes than destination buffer size: request length ={length}, with offset ={offset}; buffer capacity ={b.length - offset}\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-tools/hadoop-aliyun/src/main/java/org/apache/hadoop/fs/aliyun/oss/OSSDataBlocks.java:864 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reduce the requested read length or enlarge the destination buffer so length <= buffer capacity - offset."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}