public void write(byte[] b) throws IOException { if(closed.get()) throw new IOException("The output stream is closed"); sendMessage(b, 0, b.length); }
public void write(int b) throws IOException { if(closed.get()) throw new IOException("The output stream is closed"); byte buf[]={(byte)b}; write(buf); }
protected void sendMessage(byte[] b, int off, int len) throws IOException { Message m=new Message(stateRequester).putHeader(id, new StateHeader(StateHeader.STATE_PART)); // we're copying the buffer passed from the state provider here: if a BufferedOutputStream is used, the // buffer (b) will always be the same and can be modified after it has been set in the message ! // Fix for https://issues.jboss.org/browse/JGRP-1598 byte[] data=new byte[len]; System.arraycopy(b, off, data, 0, len); // m.setBuffer(b, off, len); m.setBuffer(data); bytesWrittenCounter+=len; if(Thread.interrupted()) throw interrupted((int)bytesWrittenCounter); down_prot.down(m); if(log.isTraceEnabled()) log.trace("%s: sent chunk of %s to %s",local_addr,Util.printBytes(len),stateRequester); }
public void write(byte[] b) throws IOException { if(closed.get()) throw new IOException("The output stream is closed"); sendMessage(b, 0, b.length); }
public void write(byte[] b, int off, int len) throws IOException { if(closed.get()) throw new IOException("The output stream is closed"); sendMessage(b, off, len); }
protected void createStreamToRequester(Address requester) { OutputStream bos=new StateOutputStream(requester); getStateFromApplication(requester, bos, false); }
public void write(int b) throws IOException { if(closed.get()) throw new IOException("The output stream is closed"); byte buf[]={(byte)b}; write(buf); }
protected void sendMessage(byte[] b, int off, int len) throws IOException { Message m=new Message(stateRequester).putHeader(id, new StateHeader(StateHeader.STATE_PART)); // we're copying the buffer passed from the state provider here: if a BufferedOutputStream is used, the // buffer (b) will always be the same and can be modified after it has been set in the message ! // Fix for https://issues.jboss.org/browse/JGRP-1598 byte[] data=new byte[len]; System.arraycopy(b, off, data, 0, len); // m.setBuffer(b, off, len); m.setBuffer(data); bytesWrittenCounter+=len; if(Thread.interrupted()) throw interrupted((int)bytesWrittenCounter); down_prot.down(m); if(log.isTraceEnabled()) log.trace("%s: sent chunk of %s to %s",local_addr,Util.printBytes(len),stateRequester); }
protected void createStreamToRequester(Address requester) { OutputStream bos=new StateOutputStream(requester); getStateFromApplication(requester, bos, false); }
public void write(byte[] b, int off, int len) throws IOException { if(closed.get()) throw new IOException("The output stream is closed"); sendMessage(b, off, len); }