473,668 Members | 2,654 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

65535 limitation for methods / functions / constructor

Can anybody answer me the question if there is any possiblity to
increase the 65535byte limitation for Java classes / methods /
functions / constructors etc.

I am currently researching in the field of Bayesian Networks. BN is a
special Knowledge representation which uses calculation via
conditional probabilities to come to a conclusion (out of some data).
The problem is that these Networks need a huge amonge of dependet
data. One of the BN Engines i am using wants to get the data input by
a class file. Some of these datas are also stored in an array of
doubles ( please dont ask me why, but the engine wants this data like
that) . My Problem now is that this array has 1024 Elments with up to
13 digits. This means the array on itself has the size of 84KB. I
cannot put this array anywhere not in the constructor or method etc.
because i cannot compile the java file (eclipse ) or i get an runtime
error which says :

Exception in thread "main" java.lang.Class FormatError: BNP_alarm (Code
od longer than 65535 bytes)...

I thought about splitting up the array but that is such a bad solution
i dont want to think about it.

Please can anybody help me with my concern and tell me if there is any
possibility to increase the limitation. Thanks Elmar
Jul 17 '05 #1
4 7070
Java bytecode isn't designed very well for supporting array initialization.
There's a few of workarounds, and you'll see them used in the Java library
itself. Your suggestion of splitting the arrays is probably the best
workaround. Another option is to store the doubles in a separate file,
within the same package, and then load the file as a resource. Then you have
to go through and parse it.

"Elmar Grandel" <El***********@ huskymail.uconn .edu> wrote in message
news:fc******** *************** ***@posting.goo gle.com...
Can anybody answer me the question if there is any possiblity to
increase the 65535byte limitation for Java classes / methods /
functions / constructors etc.

I am currently researching in the field of Bayesian Networks. BN is a
special Knowledge representation which uses calculation via
conditional probabilities to come to a conclusion (out of some data).
The problem is that these Networks need a huge amonge of dependet
data. One of the BN Engines i am using wants to get the data input by
a class file. Some of these datas are also stored in an array of
doubles ( please dont ask me why, but the engine wants this data like
that) . My Problem now is that this array has 1024 Elments with up to
13 digits. This means the array on itself has the size of 84KB. I
cannot put this array anywhere not in the constructor or method etc.
because i cannot compile the java file (eclipse ) or i get an runtime
error which says :

Exception in thread "main" java.lang.Class FormatError: BNP_alarm (Code
od longer than 65535 bytes)...

I thought about splitting up the array but that is such a bad solution
i dont want to think about it.

Please can anybody help me with my concern and tell me if there is any
possibility to increase the limitation. Thanks Elmar

Jul 17 '05 #2
El***********@h uskymail.uconn. edu (Elmar Grandel) wrote in message news:<fc******* *************** ****@posting.go ogle.com>...
Can anybody answer me the question if there is any possiblity to
increase the 65535byte limitation for Java classes / methods /
functions / constructors etc.


hi
i guess storing data in a file & then reading it should be a good idea
in your case ....

regards
amey
Jul 17 '05 #3
Ok, so me and my calculator can't figure out how you get 84KB.
A double can hold signed values of over 18 digits. This is ok. BUT
A double is 8 bytes, times 1024 is 8,192 or less than 1/10 your value.
"Elmar Grandel" <El***********@ huskymail.uconn .edu> wrote in message
news:fc******** *************** ***@posting.goo gle.com...
Can anybody answer me the question if there is any possiblity to
increase the 65535byte limitation for Java classes / methods /
functions / constructors etc.

I am currently researching in the field of Bayesian Networks. BN is a
special Knowledge representation which uses calculation via
conditional probabilities to come to a conclusion (out of some data).
The problem is that these Networks need a huge amonge of dependet
data. One of the BN Engines i am using wants to get the data input by
a class file. Some of these datas are also stored in an array of
doubles ( please dont ask me why, but the engine wants this data like
that) . My Problem now is that this array has 1024 Elments with up to
13 digits. This means the array on itself has the size of 84KB. I
cannot put this array anywhere not in the constructor or method etc.
because i cannot compile the java file (eclipse ) or i get an runtime
error which says :

Exception in thread "main" java.lang.Class FormatError: BNP_alarm (Code
od longer than 65535 bytes)...

I thought about splitting up the array but that is such a bad solution
i dont want to think about it.

Please can anybody help me with my concern and tell me if there is any
possibility to increase the limitation. Thanks Elmar

Jul 17 '05 #4
"Phil..." <ry***@ieee.org > wrote in message news:<9eFeb.811 2$%h1.6389@sccr nsc02>...
Ok, so me and my calculator can't figure out how you get 84KB.
A double can hold signed values of over 18 digits. This is ok. BUT
A double is 8 bytes, times 1024 is 8,192 or less than 1/10 your value.


Thanks a lot everybody for your help. I solved the problem with
reading the data and parsing all the data ( by JavaCC) in an array in
runtime.
Phil, you calculated right but i forgot to but another digit in the
1024. Actually it is an array with 10368 doubles, so that is round
about 83kB big array.
Bye Elmar
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

99
5881
by: David MacQuigg | last post by:
I'm not getting any feedback on the most important benefit in my proposed "Ideas for Python 3" thread - the unification of methods and functions. Perhaps it was buried among too many other less important changes, so in this thread I would like to focus on that issue alone. I have edited the Proposed Syntax example below to take out the changes unecessary to this discussion. I left in the change of "instance variable" syntax (...
17
2348
by: Picho | last post by:
Hi all, I popped up this question a while ago, and I thought it was worth checking again now... (maybe something has changed or something will change). I read this book about component oriented design (owreilly - Juval Lowy), and it was actually very nice. The book goes on about how we should use Interfaces exposure instead of classes (this is my terminology and english is not my language so I hope you understand what I'm on about...).
4
1954
by: MPF | last post by:
When designing a n-tier architecture, what is the preferred method/function accessibility? <Specifically for asp.net apps> A private constructor and shared/static methods & functions? A public constructor and non-shared/static methods & functions? Are there any drawbacks with regards to performance with either model? Thanks,
10
1754
by: John | last post by:
Trying to find out what is essential / optional, I made an extremely simple Class and Module combination to add two numbers. (see below) It appears that an empty constructor is needed n order to work right, although I quite don't see what is does in addition to the 2nd constructor. Also, the example works fine without message calls in either constructor (the numerical answer is still there and correct!). I exected it to no longer work...
12
5539
by: Andrew Poulos | last post by:
With the following code I can't understand why this.num keeps incrementing each time I create a new instance of Foo. For each instance I'm expecting this.num to alert as 1 but keeps incrementing. Foo = function(type) { this.num = 0; this.type = type this.trigger(); } Foo.prototype.trigger = function() {
6
2489
by: Taran | last post by:
Hi All, I tried something with the C++ I know and some things just seem strange. consider: #include <iostream> using namespace std;
3
1772
by: rickeringill | last post by:
Hi comp.lang.javascript, I'm throwing this in for discussion. First up I don't claim to be any sort of authority on the ecmascript language spec - in fact I'm a relative newb to these more esoteric uses (abuses?) of the language. I've been working from the oft quoted resource http://www.crockford.com/javascript/private.html. During my first serious attempt at using the knowledge acquired from this page, I ran up against the problem...
26
2530
by: Cliff Williams | last post by:
Can someone explain the pros/cons of these different ways of creating a class? // 1 function myclass() { this.foo1 = function() {...} } // 2a
5
4282
by: bizt | last post by:
Hi, Below I have a simple object / function thing (still getting head round these) declaration: function MyObject() { this.alertMe = function() { alert('hello'); }; this.alertMeAgain() {
0
8893
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8797
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7401
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5681
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4205
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4380
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2791
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2023
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1786
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.