Java license

J

JavaJug

Hi guys, sorry I don't want to speak about programming, I want to speak
about Law.
I'm not good at it, and if somebody could decrypt a bit of what's in the
java licence for me, it'd be cool...
Here it is :
I took the source code of the Piped[Input/Output]Stream classes and
changed it a bit to make some "VariablePiped[Input/Output]Stream classes
that do the same, but with a variable buffer size (if it interests
somebody...).
Am I authorized to use those classes in the software contained in the
product that the company I work in is going to sell ?

Sorry for my poor english and thanks for the answers...

Xav
 
C

Chris Smith

JavaJug said:
I took the source code of the Piped[Input/Output]Stream classes and
changed it a bit to make some "VariablePiped[Input/Output]Stream classes
that do the same, but with a variable buffer size (if it interests
somebody...).
Am I authorized to use those classes in the software contained in the
product that the company I work in is going to sell ?

IANAL, but probably not.

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
A

ak

I took the source code of the Piped[Input/Output]Stream classes and
changed it a bit to make some "VariablePiped[Input/Output]Stream classes
that do the same, but with a variable buffer size (if it interests
somebody...).

Field PipedInputStream#buffer is protected, create your own POStream with
custom buffer and forget law problems.
You can also use reflection api to change PipedInputStream#PIPE_SIZE.
 
L

Larry Barowski

JavaJug said:
Hi guys, sorry I don't want to speak about programming, I want to speak
about Law.
I'm not good at it, and if somebody could decrypt a bit of what's in the
java licence for me, it'd be cool...
Here it is :
I took the source code of the Piped[Input/Output]Stream classes and
changed it a bit to make some "VariablePiped[Input/Output]Stream classes
that do the same, but with a variable buffer size (if it interests
somebody...).
Am I authorized to use those classes in the software contained in the
product that the company I work in is going to sell ?

From the 1.4.2 code, "in", "out", and "buffer" are all protected, and
"buffer.length" is used everywhere rather than "PIPE_SIZE", which is
used only in the initialization of "buffer". Can't you do the same thing
by subclassing, without using any of the existing code?
 
J

JavaJug

Larry said:
From the 1.4.2 code, "in", "out", and "buffer" are all protected, and
"buffer.length" is used everywhere rather than "PIPE_SIZE", which is
used only in the initialization of "buffer". Can't you do the same thing
by subclassing, without using any of the existing code?
I tried at first, but was stupidly stuck as PIPE_SIZE is final.
But now that you mention it, it seems possible to subclass
PipedInputStream and overload all the non public nor protected
attributes (like connected, readSide,...) with my owns.
After that I'll just need to overload (I hope it's the good term for
french term "surcharger") the "receive" and "read" methods I've modified.
But it's the same problem with those ones : Am I allowed to copy&paste
just those methods and modify them ?
And with just a small block of code, or just a line ?

BTW, I've used the 'e' letter in my code... I'm afraid it's already used
in java sources ;)

Anyway, thanks for the help.

Xav
--
"There is a theory which states that if ever anyone discovers exactly
what the Universe is for and why it is here, it will instantly disappear
and be replaced by something even more bizarre and inexplicable.
There is another theory which states that this has already happened."
-- Douglas Adams
 
L

Larry Barowski

JavaJug said:
I tried at first, but was stupidly stuck as PIPE_SIZE is final.
But now that you mention it, it seems possible to subclass
PipedInputStream and overload all the non public nor protected
attributes (like connected, readSide,...) with my owns.
After that I'll just need to overload (I hope it's the good term for
french term "surcharger") the "receive" and "read" methods I've modified.
But it's the same problem with those ones : Am I allowed to copy&paste
just those methods and modify them ?
And with just a small block of code, or just a line ?

So you are changing the buffer size within the receive() and read()
methods? That will requite a bit of copying. I thought you just wanted
to change it externally, for some kind of on-the-fly performance
tuning or something.
 
J

JavaJug

Larry said:
So you are changing the buffer size within the receive() and read()
methods? That will requite a bit of copying. I thought you just wanted
to change it externally, for some kind of on-the-fly performance
tuning or something.
Yes, that is the goal, but the problem is :
First, as I want to resize the buffer when the pipe is full, I need to
know when it is full, i.e. access to the 'in' and 'out' fields.
Second, when you want to change the buffer size while the pipe is in
use, you need to perform some special action - just changing the buffer
size isn't enough - and therefore rewrite the read() and receive() methods.

One more problem : for example, the in and out fields are private, so I
need to overload them and use my owns. Therefore, I need to overload all
the methods that use them so they use my own and not the ones in
PipedInputStream...

So I'll do a lot of copying, I hope I'm allowed to do that.

ps : The work is done, I've got now a nice VariablePipedInputStream
class that never causes the writer to hang when he writes in the pipe
(except if the buffer size reaches a maximum value, i.e several hundred
of kilosbytes)... Handy !

Xav
 
C

Chris Gray

JavaJug said:
[...] I took the source code of the Piped[Input/Output]Stream classes and
changed it a bit to make some "VariablePiped[Input/Output]Stream classes
that do the same, but with a variable buffer size (if it interests
somebody...).
Am I authorized to use those classes in the software contained in the
product that the company I work in is going to sell ?

IANAL, TINLA, but: No.
 
L

Larry Barowski

Yes, that is the goal, but the problem is :
First, as I want to resize the buffer when the pipe is full, I need to
know when it is full, i.e. access to the 'in' and 'out' fields.
Second, when you want to change the buffer size while the pipe is in
use, you need to perform some special action - just changing the buffer
size isn't enough - and therefore rewrite the read() and receive() methods.

One more problem : for example, the in and out fields are private, so I
need to overload them and use my owns. Therefore, I need to overload all
the methods that use them so they use my own and not the ones in
PipedInputStream...

In the Java 1.2.2 and 1.4.2 code, "in" and "out" are protected rather
than private, so you can change the buffer size in a subclass while
the pipe is in use.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top