changeset 719:0c34e213f467

NC file - payload block size changed
author Devel 2
date Thu, 30 Nov 2017 08:57:22 +0100
parents 4c0a80deaa95
children 9c3779e7983a
files stress-tester/src/main/java/com/passus/st/reader/nc/NcDataBlockReader.java stress-tester/src/main/java/com/passus/st/reader/nc/NcDataBlockWriter.java stress-tester/src/main/java/com/passus/st/reader/nc/NcDataHelper.java
diffstat 3 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/stress-tester/src/main/java/com/passus/st/reader/nc/NcDataBlockReader.java	Thu Nov 30 08:48:10 2017 +0100
+++ b/stress-tester/src/main/java/com/passus/st/reader/nc/NcDataBlockReader.java	Thu Nov 30 08:57:22 2017 +0100
@@ -284,8 +284,8 @@
             throw new IOException("Invalid session id '" + sessionId + "'.");
         }
 
-        long totalSize = ncDataHelper.readLong6(buffer);
-        long dataSize = ncDataHelper.readLong6(buffer);
+        long totalSize = ncDataHelper.readLong4(buffer);
+        long dataSize = ncDataHelper.readLong4(buffer);
         int proto = ncDataHelper.readInt2(buffer);
 
         return new NcSessionPayloadBlock(timestamp, sessionId, session, totalSize, dataSize, proto, null, null);
--- a/stress-tester/src/main/java/com/passus/st/reader/nc/NcDataBlockWriter.java	Thu Nov 30 08:48:10 2017 +0100
+++ b/stress-tester/src/main/java/com/passus/st/reader/nc/NcDataBlockWriter.java	Thu Nov 30 08:57:22 2017 +0100
@@ -340,8 +340,8 @@
         buffer.putLong(timestamp);
         buffer.putInt(sessionId);
 
-        ncDataHelper.writeLong6(buffer, NcSessionPayloadBlock.HEADER_SIZE + dataSize);
-        ncDataHelper.writeLong6(buffer, dataSize);
+        ncDataHelper.writeLong4(buffer, NcSessionPayloadBlock.HEADER_SIZE + dataSize);
+        ncDataHelper.writeLong4(buffer, dataSize);
         buffer.putShort((short) proto);
 
         updateSegmentInfo(NcSessionPayloadBlock.HEADER_SIZE);
--- a/stress-tester/src/main/java/com/passus/st/reader/nc/NcDataHelper.java	Thu Nov 30 08:48:10 2017 +0100
+++ b/stress-tester/src/main/java/com/passus/st/reader/nc/NcDataHelper.java	Thu Nov 30 08:57:22 2017 +0100
@@ -183,6 +183,10 @@
         return readed;
     }
 
+    public void writeLong4(ByteBuffer buffer, long val) {
+        writeLongN(buffer, 4, val);
+    }
+
     public void writeLong6(ByteBuffer buffer, long val) {
         writeLongN(buffer, 6, val);
     }