444546474849505152535455
bb.clear(); socketChannel.read(bb); byte[] bin = bb.array(); ByteArrayInputStream bais = new ByteArrayInputStream(bin); ObjectInputStream in = new ObjectInputStream(bais); Bernoulli bernoulli = (Bernoulli)in.readObject(); bernoulli.print(); socketChannel.close(); } catch(Exception e) { System.err.println("Client communication error: "+e.getMessage()); }
2627282930313233
} public void paint(Graphics g) { String sn = tn.getText(); int n = Integer.parseInt(sn); Bernoulli bernoulli = new Bernoulli(n); rez.setText(bernoulli.asString()); }