summaryrefslogtreecommitdiff
path: root/qpid/java
diff options
context:
space:
mode:
Diffstat (limited to 'qpid/java')
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/queue/FileQueueBackingStore.java16
1 files changed, 9 insertions, 7 deletions
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/FileQueueBackingStore.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/FileQueueBackingStore.java
index bce06fad14..7c83788883 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/FileQueueBackingStore.java
+++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/FileQueueBackingStore.java
@@ -226,13 +226,16 @@ public class FileQueueBackingStore implements QueueBackingStore
for (int index = 0; index < bodyCount; index++)
{
ContentChunk chunk = message.getContentChunk(index);
- chunk.reduceToFit();
+ int length = chunk.getSize();
- byte[] chunkData = chunk.getData().array();
+ byte[] chunk_underlying = new byte[length];
+
+ ByteBuffer chunk_buf = chunk.getData();
+
+ chunk_buf.duplicate().rewind().get(chunk_underlying);
- int length = chunk.getSize();
writer.writeInt(length);
- writer.write(chunkData, 0, length);
+ writer.write(chunk_underlying, 0, length);
}
}
catch (FileNotFoundException e)
@@ -301,9 +304,8 @@ public class FileQueueBackingStore implements QueueBackingStore
}
public void delete(Long messageId)
- {
- String id = String.valueOf(messageId);
- File handle = new File(_flowToDiskLocation, id);
+ {
+ File handle = getFileHandle(messageId);
if (handle.exists())
{