long real_pos = 0;\r
StringBuilder sb = new StringBuilder();\r
\r
+ /**\r
+ * Constructor using the default buffer size\r
+ *\r
+ * @param name\r
+ * File path. This is passed as-is to the RandomeAccessFile's\r
+ * constructor.\r
+ * @param mode\r
+ * File open mode ("r", "rw", etc.). This is passed as-is to\r
+ * RandomAccessFile's constructor.\r
+ * @throws IOException\r
+ * If the file was not found or couldn't be opened with the\r
+ * request permissions\r
+ */\r
public BufferedRandomAccessFile(String name, String mode) throws IOException {\r
this(name, mode, DEFAULT_BUF_SIZE);\r
}\r
\r
+ /**\r
+ * Constructor using the default buffer size\r
+ *\r
+ * @param file\r
+ * File object. This is passed as-is to the RandomeAccessFile's\r
+ * constructor.\r
+ * @param mode\r
+ * File open mode ("r", "rw", etc.). This is passed as-is to\r
+ * RandomAccessFile's constructor.\r
+ * @throws IOException\r
+ * If the file was not found or couldn't be opened with the\r
+ * request permissions\r
+ */\r
public BufferedRandomAccessFile(File file, String mode) throws IOException {\r
this(file, mode, DEFAULT_BUF_SIZE);\r
}\r
\r
+ /**\r
+ * Standard constructor.\r
+ *\r
+ * @param name\r
+ * File path. This is passed as-is to the RandomeAccessFile's\r
+ * constructor.\r
+ * @param mode\r
+ * File open mode ("r", "rw", etc.). This is passed as-is to\r
+ * RandomAccessFile's constructor.\r
+ * @param bufsize\r
+ * Buffer size to use, in bytes\r
+ * @throws IOException\r
+ * If the file was not found or couldn't be opened with the\r
+ * request permissions\r
+ */\r
public BufferedRandomAccessFile(String name, String mode, int bufsize) throws IOException {\r
super(name, mode);\r
invalidate();\r
buffer = new byte[BUF_SIZE];\r
}\r
\r
+ /**\r
+ * Standard constructor.\r
+ *\r
+ * @param file\r
+ * File object. This is passed as-is to the RandomeAccessFile's\r
+ * constructor.\r
+ * @param mode\r
+ * File open mode ("r", "rw", etc.). This is passed as-is to\r
+ * RandomAccessFile's constructor.\r
+ * @param bufsize\r
+ * Buffer size to use, in bytes\r
+ * @throws IOException\r
+ * If the file was not found or couldn't be opened with the\r
+ * request permissions\r
+ */\r
public BufferedRandomAccessFile(File file, String mode, int bufsize) throws IOException {\r
super(file, mode);\r
invalidate();\r
}\r
}\r
\r
+ /**\r
+ * Read the next line from the buffer (ie, until the next '\n'). The bytes\r
+ * are interpreted as UTF-8 characters.\r
+ *\r
+ * @return The String that was read\r
+ * @throws IOException\r
+ * If we failed reading the file\r
+ */\r
public final String getNextLine() throws IOException {\r
String str = null;\r
if (buf_end - buf_pos <= 0) {\r