{"record":{"id":"f70ec27dacf8cbcc","repo":"apache/hadoop","slug":"byte-buffer-pread-unsupported-by-classname","errorCode":null,"errorMessage":"Byte-buffer pread unsupported by ${className}","messagePattern":"Byte-buffer pread unsupported by (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FSDataInputStream.java","lineNumber":262,"sourceCode":"  public boolean hasCapability(String capability) {\n    return StoreImplementationUtils.hasCapability(in, capability);\n  }\n\n  /**\n   * String value. Includes the string value of the inner stream\n   * @return the stream\n   */\n  @Override\n  public String toString() {\n    return super.toString() + \": \" + in;\n  }\n\n  @Override\n  public int read(long position, ByteBuffer buf) throws IOException {\n    if (in instanceof ByteBufferPositionedReadable) {\n      return ((ByteBufferPositionedReadable) in).read(position, buf);\n    }\n    throw new UnsupportedOperationException(\"Byte-buffer pread unsupported \" +\n        \"by \" + in.getClass().getCanonicalName());\n  }\n\n  /**\n   * Delegate to the underlying stream.\n   * @param position position within file\n   * @param buf the ByteBuffer to receive the results of the read operation.\n   * @throws IOException on a failure from the nested stream.\n   * @throws UnsupportedOperationException if the inner stream does not\n   * support this operation.\n   */\n  @Override\n  public void readFully(long position, ByteBuffer buf) throws IOException {\n    if (in instanceof ByteBufferPositionedReadable) {\n      ((ByteBufferPositionedReadable) in).readFully(position, buf);\n    } else {\n      throw new UnsupportedOperationException(\"Byte-buffer pread \" +\n              \"unsupported by \" + in.getClass().getCanonicalName());","sourceCodeStart":244,"sourceCodeEnd":280,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FSDataInputStream.java#L244-L280","documentation":"Error \"Byte-buffer pread unsupported by ${className}\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FSDataInputStream.java:262 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use positional byte-array pread instead of ByteBuffer pread.","Check hasCapability(\"in:preadbytebuffer\") before use; fall back to regular pread when unsupported."],"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-22T20:17:22.307Z"}