{"record":{"id":"5edd183d2b4b59b3","repo":"apache/hadoop","slug":"byte-buffer-read-unsupported-by-classname","errorCode":null,"errorMessage":"Byte-buffer read unsupported by ${className}","messagePattern":"Byte-buffer read 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":160,"sourceCode":"  \n  /**\n   * Get a reference to the wrapped input stream. Used by unit tests.\n   *\n   * @return the underlying input stream\n   */\n  @InterfaceAudience.Public\n  @InterfaceStability.Stable\n  public InputStream getWrappedStream() {\n    return in;\n  }\n\n  @Override\n  public int read(ByteBuffer buf) throws IOException {\n    if (in instanceof ByteBufferReadable) {\n      return ((ByteBufferReadable)in).read(buf);\n    }\n\n    throw new UnsupportedOperationException(\"Byte-buffer read unsupported \" +\n            \"by \" + in.getClass().getCanonicalName());\n  }\n\n  @Override\n  public FileDescriptor getFileDescriptor() throws IOException {\n    if (in instanceof HasFileDescriptor) {\n      return ((HasFileDescriptor) in).getFileDescriptor();\n    } else if (in instanceof FileInputStream) {\n      return ((FileInputStream) in).getFD();\n    } else {\n      return null;\n    }\n  }\n\n  @Override\n  public void setReadahead(Long readahead)\n      throws IOException, UnsupportedOperationException {\n    try {","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FSDataInputStream.java#L142-L178","documentation":"Error \"Byte-buffer read unsupported by ${className}\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FSDataInputStream.java:160 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use the byte-array read() APIs instead of ByteBuffer reads.","Check hasCapability(\"in:readbytebuffer\") before calling ByteBuffer read.","Provide a HasEnhancedByteBufferAccess-capable stream from the filesystem implementation."],"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"}