Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sep 20 11:44:10 Updated: krb5-workstation-1.9-33.el6_3.3.x86_64
- Sep 20 11:44:11 Updated: qpid-cpp-server-ssl-0.14-22.el6_3.x86_64
- Sep 20 11:44:11 Updated: qpid-tools-0.14-6.el6_3.noarch
- Sep 21 11:58:30 Updated: libxml2-2.7.6-8.el6_3.3.x86_64
- Sep 21 11:58:35 Updated: libxml2-devel-2.7.6-8.el6_3.3.x86_64
- Sep 21 11:58:37 Updated: libxml2-python-2.7.6-8.el6_3.3.x86_64
- Sep 26 19:01:09 Updated: kernel-firmware-2.6.32-279.9.1.el6.noarch
- Sep 26 19:01:21 Installed: kernel-2.6.32-279.9.1.el6.x86_64
- Sep 26 19:01:44 Installed: kernel-devel-2.6.32-279.9.1.el6.x86_64
- Sep 26 19:01:51 Updated: kernel-headers-2.6.32-279.9.1.el6.x86_64
- Sep 26 19:02:12 Updated: google-chrome-stable-22.0.1229.79-158531.x86_64
- public static void tail(File src, OutputStream out, int maxLines) throws FileNotFoundException, IOException {
- BufferedReader reader = new BufferedReader(new FileReader(src));
- String[] lines = new String[maxLines];
- int lastNdx = 0;
- for (String line=reader.readLine(); line != null; line=reader.readLine()) {
- if (lastNdx == lines.length) {
- lastNdx = 0;
- }
- lines[lastNdx++] = line;
- }
- OutputStreamWriter writer = new OutputStreamWriter(out);
- for (int ndx=lastNdx; ndx != lastNdx-1; ndx++) {
- if (ndx == lines.length) {
- ndx = 0;
- }
- writer.write(lines[ndx]);
- writer.write("n");
- }
- writer.flush();
- }
Add Comment
Please, Sign In to add comment