Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #9124

Re: Buffers not Serializable in Java?

From Lew <lewbloch@gmail.com>
Newsgroups comp.lang.java.programmer
Subject Re: Buffers not Serializable in Java?
Date 2011-10-23 16:01 -0700
Organization http://groups.google.com
Message-ID <4227919.669.1319410915805.JavaMail.geo-discussion-forums@yqgd7> (permalink)
References <a12ae79e-0c35-41b4-ae36-6f9a84cc588b@q13g2000vbd.googlegroups.com>

Show all headers | View raw


bob wrote:
> Why are Buffers not Serializable in Java?
(One presumes to assume that you refer here to 'java.nio.Buffer'.)

Why should they be?

What would a serialized 'Buffer' mean, exactly?

A 'Buffer' is a holder for serialized data already, is it not?

It's sort of like serializing a Reader or a Writer.  It boils down to what one considers state for the type.  

Anyway, 'Buffer' is intended as a staging area between things, a conduit for serialization.  You would simply transmit the contents of the 'Buffer'.

Now one gives you the benefit of the doubt that you really want to serialize one of the subtypes of 'Buffer', since you can't instantiate an abstract class.

Near as I can tell, you can quite readily serialize the 'array()' results given back by these subtypes are all serializable, so you're only one method call away.

Now, please answer in return, why in the world do you want to serialize a 'Buffer'?

-- 
Lew

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Buffers not Serializable in Java? bob <bob@coolgroups.com> - 2011-10-23 11:11 -0700
  Re: Buffers not Serializable in Java? Lew <lewbloch@gmail.com> - 2011-10-23 16:01 -0700
  Re: Buffers not Serializable in Java? dagon@dagon.net (Dagon) - 2011-10-23 13:16 -0700
  Re: Buffers not Serializable in Java? Roedy Green <see_website@mindprod.com.invalid> - 2011-10-23 21:02 -0700

csiph-web