Uploaded image for project: 'QuickFIX/J'
  1. QuickFIX/J
  2. QFJ-684

Support for binary data (BytesField) does not (and cannot) work on full range of bytes

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Default
    • Resolution: Fixed
    • Affects Version/s: 1.4.0
    • Fix Version/s: 3.0.0
    • Component/s: None
    • Labels:
      None

      Description

      The BytesField support for putting raw bytes into a message does not work unless the bytes are compatible with the charset. e.g., the test below will fail. If QF/J is to support raw data fields (and encoded fields), some areas that currently work on/as Strings will need to change to work on byte[]s or ByteBuffers. In the mean time, if BytesField can't work, best to remove it.

      public void testBytesFieldForReal()
      throws Exception

      { byte[] data = new byte[256]; for(int i = 0; i < 256; ++i) data[i] = (byte)i; BytesField field = new BytesField(RawData.FIELD); field.setValue(data); StringBuilder sb = new StringBuilder(); field.toString(sb); byte[] tagBytes = sb.toString().getBytes(CharsetSupport.getCharset()); assertEquals(256 + 3, tagBytes.length); for(int i = 0; i < data.length; ++i) assertEquals(data[i], tagBytes[i + 3]); }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alphashock Marcin L
                Reporter:
                ryarran Rhys Yarranton
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: