diff --git a/src/main/java/org/apache/hadoop/fs/cosn/buffer/CosNByteBuffer.java b/src/main/java/org/apache/hadoop/fs/cosn/buffer/CosNByteBuffer.java index a9d767c2..246ce0cd 100644 --- a/src/main/java/org/apache/hadoop/fs/cosn/buffer/CosNByteBuffer.java +++ b/src/main/java/org/apache/hadoop/fs/cosn/buffer/CosNByteBuffer.java @@ -23,7 +23,7 @@ public CosNByteBuffer(ByteBuffer byteBuffer) { } public CosNByteBuffer put(byte b) throws IOException { - if (this.byteBuffer.hasRemaining()) { + if (!this.byteBuffer.hasRemaining()) { throw new IOException("There is no remaining in the buffer."); } this.byteBuffer.put(b);