Hi Aquafina, I'm not a MINA expert, but as far as I know, you can wrap a byte array into ByteBuffer by using ByteBuffer.wrap(byte[] byteArray, int offset, int length), and send it through IoSession.write(the ByteBuffer instance); Please be aware that by doing this, you bypass your costumized ProtocalEncoder/Decoder.
Wrap a byte array into a serilizable object, just in sake of sending it alone, is a bit redundant IMHO. The wrap object will need to go through ObjectSerializationDecoder and ObjectSerializationEncoder, which add some extra cost. Cheers, Qi aquafina wrote: > > Hello, > > I am new with MINA. Would anyone please show me how to configure > SocketAcceptorConfig to receive/send a byte[]. I tried to wrap it with a > Serializable object and used > > cfg.getFilterChain().addLast( > "codec", > new ProtocolCodecFilter( > new ObjectSerializationCodecFactory())); > > but it doesn't seem to work. > > Thanks, > > > -- View this message in context: http://www.nabble.com/sending-receiving-a-byte---tf4958040s16868.html#a14203971 Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.
