All pastes #560936 Raw Edit

Stuff

public text v1 · immutable
·published 2007-06-12 08:22 UTC
rendered paste body
Socket socket = new Socket(add, port);
socket.setTcpNoDelay(true);

cipherEn = Cipher.getInstance(SYM_ALGORITHM);
cipherEn.init(Cipher.ENCRYPT_MODE, secretKey);
cout = new CipherOutputStream(out, cipherEn);



	public void sendMessage(String message) {
			byte[] m = new byte[SIZE];
			byte[] temp = message.getBytes();
			int last = 0;
			
			for(int i=0; i<message.length()/SIZE; i++) {
				for(int j=0; j<SIZE; j++) 
					m[j] = temp[j+last];
				
				last += SIZE;
				cout.write(m);
				cout.flush();
			}
			
	}