Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9023365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:44:37+00:00 2026-06-16T05:44:37+00:00

I am really struggling to complete this piece, any thoughts or pointers will help

  • 0

I am really struggling to complete this piece, any thoughts or pointers will help me a lot. Here is my problem:

  1. I am working on ISO 8583 layer and data element 32 is defined as n ..11, which means the element is numeric, variable length with max size 11.

  2. and this need to be sent in binary format (not ASCII).

  3. We need to show LLNN, ex ISO binary raw should look like this : 11 06 01 04 00 00 00

Till now I was able to complete fill the byte[] array with (11/2)+(11%2) size of 6 with BCD(06 01 04 00 00 00). and I got the total length of the field calculated as 11, Now I need to insert this at byte[0] with the 11 not 0B i.e 0001 0001 packed to one byte byte[]as 11 , my logic as shown below when I give nBytes=1(first 255 chars in BCD ISO) it will insert the length field value as either 0b 01 04 00 00 00 or if i pass nBytes as 2, its giving 00 0b 04 00 00 00. Something going wrong with the right shift logic…

Can somebody help me and correct this below logic to bring the results as 11 06 01 04 00 00 00

int nBytes=1;
for (int i = nBytes - 1; i >= 0; i--) {
    buf[i] = (byte)(length & 0xFF);
    length >>= 8;
}
outstream.write(buf);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T05:44:39+00:00Added an answer on June 16, 2026 at 5:44 am

    I have finally ended up using the two byte array objects. One holding the original request and calculating the length of the field in decimal and putting it in the first location i.e. 0 index of the secondary byte array and appending the original byte array to this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Really struggling to understand this problem, any ideas are welcome I have a carousel
I'm really new to Ruby (first day!) and I'm struggling with this here. I'm
Really struggling with this simple code here. I'm checking if the section with #setactionsuccess
I'm really struggling to convert this timestamp to a nice formatted date string. Here's
I am really struggling on this. I have an XML feed: <?xml version=1.0 encoding=ISO-8859-1?>
I'm really struggling with this piece of code. What I'm trying to achieve: I
Really struggling to figure this out. Just trying to take in data from php
Im really struggling to get my head round this. Im using c#. I want
I'm really struggling with this. I have a viewdetails.php page, addnew.php page and a
OK i am really struggling with this! I know had to add an image

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.