[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jedit-cvs
Subject:    [ jEdit-commits ] SF.net SVN: jedit: [9024]
From:       ezust () users ! sourceforge ! net
Date:       2007-02-26 16:43:53
Message-ID: E1HLix7-00029H-Uw () sc8-pr-svn4 ! sourceforge ! net
[Download RAW message or body]

Revision: 9024
          http://svn.sourceforge.net/jedit/?rev=9024&view=rev
Author:   ezust
Date:     2007-02-26 08:43:53 -0800 (Mon, 26 Feb 2007)

Log Message:
-----------
Organized imports, moved members to the top, fixed javadoc.

Modified Paths:
--------------
    jEdit/trunk/org/gjt/sp/jedit/bufferio/BufferIORequest.java

Modified: jEdit/trunk/org/gjt/sp/jedit/bufferio/BufferIORequest.java
===================================================================
--- jEdit/trunk/org/gjt/sp/jedit/bufferio/BufferIORequest.java	2007-02-26 16:34:48 \
                UTC (rev 9023)
+++ jEdit/trunk/org/gjt/sp/jedit/bufferio/BufferIORequest.java	2007-02-26 16:43:53 \
UTC (rev 9024) @@ -23,15 +23,28 @@
 package org.gjt.sp.jedit.bufferio;
 
 //{{{ Imports
+import java.io.BufferedOutputStream;
+import java.io.CharConversionException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Reader;
+import java.io.Writer;
+import java.nio.charset.CharacterCodingException;
+import java.nio.charset.Charset;
+
 import javax.swing.text.Segment;
-import java.io.*;
-import java.nio.charset.*;
-import java.nio.CharBuffer;
-import java.nio.ByteBuffer;
-import org.gjt.sp.jedit.io.*;
-import org.gjt.sp.jedit.*;
+
+import org.gjt.sp.jedit.Buffer;
+import org.gjt.sp.jedit.MiscUtilities;
+import org.gjt.sp.jedit.View;
+import org.gjt.sp.jedit.jEdit;
 import org.gjt.sp.jedit.buffer.JEditBuffer;
-import org.gjt.sp.util.*;
+import org.gjt.sp.jedit.io.VFS;
+import org.gjt.sp.util.IntegerArray;
+import org.gjt.sp.util.SegmentBuffer;
+import org.gjt.sp.util.WorkRequest;
 //}}}
 
 /**
@@ -66,23 +79,6 @@
 	public static final int IOBUFSIZE = 32768;
 
 	/**
-	 * Size of character I/O buffers.
-	 */
-	public static final int getCharIOBufferSize()
-	{
-		return IOBUFSIZE;
-	}
-
-	/**
-	 * Size of byte I/O buffers.
-	 */
-	public static final int getByteIOBufferSize()
-	{
-		// 2 is sizeof char in byte;
-		return IOBUFSIZE * 2;
-	}
-
-	/**
 	 * Number of lines per progress increment.
 	 */
 	public static final int PROGRESS_INTERVAL = 300;
@@ -98,6 +94,16 @@
 
 	//}}}
 
+	//{{{ Instance variables
+	protected final View view;
+	protected final Buffer buffer;
+	protected final Object session;
+	protected final VFS vfs;
+	protected String path;
+	protected final String markersPath;
+	//}}}
+
+
 	//{{{ BufferIORequest constructor
 	/**
 	 * Creates a new buffer I/O request.
@@ -125,17 +131,24 @@
 		return getClass().getName() + '[' + buffer + ']';
 	} //}}}
 
-	//{{{ Private members
 
-	//{{{ Instance variables
-	protected final View view;
-	protected final Buffer buffer;
-	protected final Object session;
-	protected final VFS vfs;
-	protected String path;
-	protected final String markersPath;
-	//}}}
+	/**
+	 * Size of character I/O buffers.
+	 */
+	public static final int getCharIOBufferSize()
+	{
+		return IOBUFSIZE;
+	}
 
+	/**
+	 * Size of byte I/O buffers.
+	 */
+	public static final int getByteIOBufferSize()
+	{
+		// 2 is sizeof char in byte;
+		return IOBUFSIZE * 2;
+	}
+	
 	//{{{ autodetect() method
 	/**
 	 * Tries to detect if the stream is gzipped, and if it has an encoding
@@ -172,11 +185,11 @@
 
 		char[] buf = new char[IOBUFSIZE];
 
-		// Number of characters in 'buf' array.
-		// InputStream.read() doesn't always fill the
-		// array (eg, the file size is not a multiple of
-		// IOBUFSIZE, or it is a GZipped file, etc)
-		int len;
+		/* Number of characters in 'buf' array.
+		 InputStream.read() doesn't always fill the
+		 array (eg, the file size is not a multiple of
+		 IOBUFSIZE, or it is a GZipped file, etc) */
+ 		int len;
 
 		// True if a \n was read after a \r. Usually
 		// means this is a DOS/Windows file
@@ -237,28 +250,20 @@
 					lastLine = i + 1;
 					break;
 				case '\n':
-					// If lastWasCR is true,
-					// we just read a \r followed
-					// by a \n. We specify that
-					// this is a Windows file,
-					// but take no further
-					// action and just ignore
-					// the \r.
+					/* If lastWasCR is true, we just read a \r followed
+					 by a \n. We specify that this is a Windows file,
+					 but take no further action and just ignore the \r. */
 					if(lastWasCR)
 					{
 						CROnly = false;
 						CRLF = true;
 						lastWasCR = false;
-						// Bump lastLine so
-						// that the next line
-						// doesn't erronously
-						// pick up the \r
-						lastLine = i + 1;
+						/* Bump lastLine so that the next line doesn't erronously
+						  pick up the \r */ 
+						lastLine = i + 1; 
 					}
-					// Otherwise, we found a \n
-					// that follows some other
-					// character, hence we have
-					// a Unix file
+					/* Otherwise, we found a \n that follows some other
+					 *  character, hence we have a Unix file */
 					else
 					{
 						CROnly = false;
@@ -273,11 +278,9 @@
 					}
 					break;
 				default:
-					// If we find some other
-					// character that follows
-					// a \r, so it is not a
-					// Windows file, and probably
-					// a Mac file
+					/*  If we find some other character that follows
+					 a \r, so it is not a Windows file, and probably
+					 a Mac file */
 					if(lastWasCR)
 					{
 						CROnly = true;


This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
jEdit-CVS mailing list
jEdit-CVS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jedit-cvs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic