Fix #11756 empty byte array for no content in ChunkAccumulator
This commit is contained in:
parent
10d0898460
commit
eafa7ab0d6
|
@ -72,7 +72,7 @@ public class ChunkAccumulator
|
|||
public byte[] take()
|
||||
{
|
||||
if (_length == 0)
|
||||
return BufferUtil.EMPTY_BUFFER.array();
|
||||
return BufferUtil.EMPTY_BYTES;
|
||||
byte[] bytes = new byte[_length];
|
||||
int offset = 0;
|
||||
for (Chunk chunk : _chunks)
|
||||
|
|
|
@ -106,7 +106,8 @@ public class BufferUtil
|
|||
(byte)'E', (byte)'F'
|
||||
};
|
||||
|
||||
public static final ByteBuffer EMPTY_BUFFER = ByteBuffer.wrap(new byte[0]).asReadOnlyBuffer();
|
||||
public static final byte[] EMPTY_BYTES = new byte[0];
|
||||
public static final ByteBuffer EMPTY_BUFFER = ByteBuffer.wrap(EMPTY_BYTES).asReadOnlyBuffer();
|
||||
|
||||
/**
|
||||
* Allocate ByteBuffer in flush mode.
|
||||
|
|
Loading…
Reference in New Issue