protected int gatheringFlush(Buffer header, ByteBuffer bbuf0, Buffer buffer, ByteBuffer bbuf1) throws IOException { int length; synchronized(this) { // Adjust position indexs of buf0 and buf1 bbuf0=bbuf0.asReadOnlyBuffer(); bbuf0.position(header.getIndex()); bbuf0.limit(header.putIndex()); bbuf1=bbuf1.asReadOnlyBuffer(); bbuf1.position(buffer.getIndex()); bbuf1.limit(buffer.putIndex()); _gather2[0]=bbuf0; _gather2[1]=bbuf1; // do the gathering write. length=(int)((GatheringByteChannel)_channel).write(_gather2); int hl=header.length(); if (length>hl) { header.clear(); buffer.skip(length-hl); } else if (length>0) { header.skip(length); } } return length; }
protected int gatheringFlush(Buffer header, ByteBuffer bbuf0, Buffer buffer, ByteBuffer bbuf1) throws IOException { int length; synchronized(this) { // Adjust position indexs of buf0 and buf1 bbuf0=bbuf0.asReadOnlyBuffer(); bbuf0.position(header.getIndex()); bbuf0.limit(header.putIndex()); bbuf1=bbuf1.asReadOnlyBuffer(); bbuf1.position(buffer.getIndex()); bbuf1.limit(buffer.putIndex()); _gather2[0]=bbuf0; _gather2[1]=bbuf1; // do the gathering write. length=(int)((GatheringByteChannel)_channel).write(_gather2); int hl=header.length(); if (length>hl) { header.clear(); buffer.skip(length-hl); } else if (length>0) { header.skip(length); } } return length; }
protected int gatheringFlush(Buffer header, ByteBuffer bbuf0, Buffer buffer, ByteBuffer bbuf1) throws IOException { int length; synchronized(this) { // Adjust position indexs of buf0 and buf1 bbuf0=bbuf0.asReadOnlyBuffer(); bbuf0.position(header.getIndex()); bbuf0.limit(header.putIndex()); bbuf1=bbuf1.asReadOnlyBuffer(); bbuf1.position(buffer.getIndex()); bbuf1.limit(buffer.putIndex()); _gather2[0]=bbuf0; _gather2[1]=bbuf1; // do the gathering write. length=(int)((GatheringByteChannel)_channel).write(_gather2); int hl=header.length(); if (length>hl) { header.clear(); buffer.skip(length-hl); } else if (length>0) { header.skip(length); } } return length; }
protected int gatheringFlush(Buffer header, ByteBuffer bbuf0, Buffer buffer, ByteBuffer bbuf1) throws IOException { int length; synchronized(this) { // Adjust position indexs of buf0 and buf1 bbuf0=bbuf0.asReadOnlyBuffer(); bbuf0.position(header.getIndex()); bbuf0.limit(header.putIndex()); bbuf1=bbuf1.asReadOnlyBuffer(); bbuf1.position(buffer.getIndex()); bbuf1.limit(buffer.putIndex()); _gather2[0]=bbuf0; _gather2[1]=bbuf1; // do the gathering write. length=(int)((GatheringByteChannel)_channel).write(_gather2); int hl=header.length(); if (length>hl) { header.clear(); buffer.skip(length-hl); } else if (length>0) { header.skip(length); } } return length; }
public static Buffer getHeaderName(Buffer _buffer, View tok) { int len=((_buffer.peek()&0xFF)<<8)|(_buffer.peek(_buffer.getIndex()+1)&0xFF); if ((0xFF00&len)==0xA000) { _buffer.skip(1); return Ajp13RequestHeaders.CACHE.get(_buffer.get()); } int start=_buffer.getIndex(); tok.update(start+2,start+len+2); _buffer.skip(len+3); return tok; }
public int flush(Buffer buffer) throws IOException { if (_closed) throw new IOException("CLOSED"); if (_growOutput && buffer.length()>_out.space()) { _out.compact(); if (buffer.length()>_out.space()) { ByteArrayBuffer n = new ByteArrayBuffer(_out.putIndex()+buffer.length()); n.put(_out.peek(0,_out.putIndex())); if (_out.getIndex()>0) { n.mark(); n.setGetIndex(_out.getIndex()); } _out=n; } } int len = _out.put(buffer); if (!buffer.isImmutable()) buffer.skip(len); return len; }
public int flush(Buffer buffer) throws IOException { if (_closed) throw new IOException("CLOSED"); if (_growOutput && buffer.length()>_out.space()) { _out.compact(); if (buffer.length()>_out.space()) { ByteArrayBuffer n = new ByteArrayBuffer(_out.putIndex()+buffer.length()); n.put(_out.peek(0,_out.putIndex())); if (_out.getIndex()>0) { n.mark(); n.setGetIndex(_out.getIndex()); } _out=n; } } int len = _out.put(buffer); if (!buffer.isImmutable()) buffer.skip(len); return len; }
public int flush(Buffer buffer) throws IOException { if (_closed) throw new IOException("CLOSED"); if (_growOutput && buffer.length()>_out.space()) { _out.compact(); if (buffer.length()>_out.space()) { ByteArrayBuffer n = new ByteArrayBuffer(_out.putIndex()+buffer.length()); n.put(_out.peek(0,_out.putIndex())); if (_out.getIndex()>0) { n.mark(); n.setGetIndex(_out.getIndex()); } _out=n; } } int len = _out.put(buffer); if (!buffer.isImmutable()) buffer.skip(len); return len; }
public int flush(Buffer buffer) throws IOException { if (_closed) throw new IOException("CLOSED"); if (_growOutput && buffer.length()>_out.space()) { _out.compact(); if (buffer.length()>_out.space()) { ByteArrayBuffer n = new ByteArrayBuffer(_out.putIndex()+buffer.length()); n.put(_out.peek(0,_out.putIndex())); if (_out.getIndex()>0) { n.mark(); n.setGetIndex(_out.getIndex()); } _out=n; } } int len = _out.put(buffer); if (!buffer.isImmutable()) buffer.skip(len); return len; }
take=_body.length(); _body.peek(_body.getIndex(),take); _body.skip(_header.put(_body.peek(_body.getIndex(),take)));
take=_body.length(); _body.peek(_body.getIndex(),take); _body.skip(_header.put(_body.peek(_body.getIndex(),take)));
take=_body.length(); _body.peek(_body.getIndex(),take); _body.skip(_header.put(_body.peek(_body.getIndex(),take)));
take=_body.length(); _body.peek(_body.getIndex(),take); _body.skip(_header.put(_body.peek(_body.getIndex(),take)));
take=_body.length(); _body.peek(_body.getIndex(),take); _body.skip(_header.put(_body.peek(_body.getIndex(),take)));