{"record":{"id":"3d321071e621a57b","repo":"apache/hadoop","slug":"byte-arrays-are-not-supported-for-directdecompre-3d3210","errorCode":null,"errorMessage":"byte[] arrays are not supported for DirectDecompressor","messagePattern":"byte\\[\\] arrays are not supported for DirectDecompressor","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/compress/zlib/ZlibDecompressor.java","lineNumber":385,"sourceCode":"      super.reset();\n      endOfInput = true;\n    }\n    \n    private boolean endOfInput;\n\n    @Override\n    public void decompress(ByteBuffer src, ByteBuffer dst)\n        throws IOException {\n      assert dst.isDirect() : \"dst.isDirect()\";\n      assert src.isDirect() : \"src.isDirect()\";\n      assert dst.remaining() > 0 : \"dst.remaining() > 0\";      \n      this.inflateDirect(src, dst);\n      endOfInput = !src.hasRemaining();\n    }\n\n    @Override\n    public void setDictionary(byte[] b, int off, int len) {\n      throw new UnsupportedOperationException(\n          \"byte[] arrays are not supported for DirectDecompressor\");\n    }\n\n    @Override\n    public int decompress(byte[] b, int off, int len) {\n      throw new UnsupportedOperationException(\n          \"byte[] arrays are not supported for DirectDecompressor\");\n    }\n  }\n}\n","sourceCodeStart":367,"sourceCodeEnd":396,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/compress/zlib/ZlibDecompressor.java#L367-L396","documentation":"Error \"byte[] arrays are not supported for DirectDecompressor\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/compress/zlib/ZlibDecompressor.java:385 when the library encounters an invalid state.","commonSituations":"Occurs when a direct (native) ZlibDecompressor is asked to decompress from a byte[] array. Use a direct ByteBuffer for direct decompressors, or use the non-direct code path for heap arrays.","solutions":["Use a ZlibDecompressor constructed with a direct-Buffer-capable decompressor, or switch to the byte[]-based API.","Do not pass heap byte arrays to a DirectDecompressor; use direct ByteBuffers or a non-direct decompressor instance."],"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"}