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 1041033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:17:54+00:00 2026-05-16T15:17:54+00:00

I have a data of Element class. I’m trying to write its values to

  • 0

I have a data of Element class. I’m trying to write its values to a file but I’m having trouble:

< Some process to acquire values into the variable "fieldData" >

// Prepare file output
FileWriter fstream = new FileWriter("C:/output.txt");
BufferedWriter out = new BufferedWriter(fstream);

Element field = fieldData.getElement(i);

out.write(field);  // DOESN'T WORK: The method write(int) in the type BufferedWriter is not applicable for the arguments (Element)
out.write(field.getValueAsString()); // DOESN'T WORK: Cannot convert SEQUENCE to String

Any suggestions on how I should handle this case? In addition, what is the best way for me to see (i.e. print out to screen) the available static variables and methods associated with an object? Thx.

More code snippets to help debug:

private static final Name SECURITY_DATA = new Name("securityData");
private static final Name FIELD_DATA = new Name("fieldData");

Element securityDataArray = msg.getElement(SECURITY_DATA); // msg is a Bloomberg desktop API object
Element securityData = securityDataArray.getValueAsElement(0);
Element fieldData = securityData.getElement(FIELD_DATA);
Element field = fieldData.getElement(0)
out.write(field);  // DOESN'T WORK: The method write(int) in the type BufferedWriter is not applicable for the arguments (Element)
out.write(field.getValueAsString()); // DOESN'T WORK: Cannot convert SEQUENCE to String
  • 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-05-16T15:17:54+00:00Added an answer on May 16, 2026 at 3:17 pm

    Turns out that this Bloomberg Prop data structure is long-winded to say the least:

    private static final Name SECURITY_DATA = new Name("securityData");
    private static final Name FIELD_DATA = new Name("fieldData");
    
    Element securityDataArray = msg.getElement(SECURITY_DATA); // msg is a Bloomberg desktop API object
    Element securityData = securityDataArray.getValueAsElement(0);
    Element fieldData = securityData.getElement(FIELD_DATA);
    Element field = fieldData.getElement(0); 
    
    /* the above codes were known at the time of the question */
    /* below is what I was shown by a bloomberg representative */
    
    Element bulkElement = field.getValueAsElement(0);
    Element elem = bulkElement.getElement(0);
    out.write(elem.name() + "\t" + elem.getValueAsString() + "\n");
    

    whew…I don’t think they try to make it easy! I’m also curious as to if there was a way that I could have figure this out by having Java print out the right method to use to trace down the data structure?

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

Sidebar

Related Questions

I have a rather large list of data that contains 5 properties per element.
I have to login in to various elements to retrieve some data, problem is
I have binary data in a file that I can read into a byte
Where can I find some good documentation on data/element binding? My Google searches haven't
I have a data set whose elements are displayed as rows in a DataGrid.
Assuming Visual C/C++ 6, I have a complex data structure of 22399 elements that
I have several identical elements with different attributes that I'm accessing with SimpleXML: <data>
I have data in a MySQL database. I am sending the user a URL
I have data coming from the database in the form of a DataSet .
I have data that looks like CUSTOMER, CUSTOMER_ID, PRODUCT ABC INC 1 XYX ABC

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.