Package java.io

Examples of java.io.RandomAccessFile.writeBytes()


            ras.writeBytes("             <fragment name=\"col" + count + "\" type=\"column\">" + PlutoAdminConstants.LS);
          }

            ras.writeBytes("                  <fragment name=\"p" + count + "\" type=\"portlet\">" + PlutoAdminConstants.LS);
            ras.writeBytes("                    <property name=\"portlet\" value=\"" + portlet.getValue() + "\"/>" + PlutoAdminConstants.LS);
            ras.writeBytes("                  </fragment><!-- end of portlet frag -->" + PlutoAdminConstants.LS);

            //end row fragment
            if (cols == currCol) {
              ras.writeBytes("             </fragment><!-- end of col frag -->" + PlutoAdminConstants.LS);
              //end of column iteration
View Full Code Here


            ras.writeBytes("                    <property name=\"portlet\" value=\"" + portlet.getValue() + "\"/>" + PlutoAdminConstants.LS);
            ras.writeBytes("                  </fragment><!-- end of portlet frag -->" + PlutoAdminConstants.LS);

            //end row fragment
            if (cols == currCol) {
              ras.writeBytes("             </fragment><!-- end of col frag -->" + PlutoAdminConstants.LS);
              //end of column iteration
              ras.writeBytes("         </fragment><!-- end of row frag -->" + PlutoAdminConstants.LS);
            }
          lastRow = currRow;
      }
View Full Code Here

            //end row fragment
            if (cols == currCol) {
              ras.writeBytes("             </fragment><!-- end of col frag -->" + PlutoAdminConstants.LS);
              //end of column iteration
              ras.writeBytes("         </fragment><!-- end of row frag -->" + PlutoAdminConstants.LS);
            }
          lastRow = currRow;
      }

      //end page fragment
View Full Code Here

            }
          lastRow = currRow;
      }

      //end page fragment
      ras.writeBytes("    </fragment><!-- end of 'page' frag -->" + PlutoAdminConstants.LS);
      //add a couple of newlines to separate records
      ras.writeBytes(PlutoAdminConstants.LS);
      ras.writeBytes(PlutoAdminConstants.LS);
      //replace closing root element
      ras.writeBytes("</portal>" + PlutoAdminConstants.LS);
View Full Code Here

      }

      //end page fragment
      ras.writeBytes("    </fragment><!-- end of 'page' frag -->" + PlutoAdminConstants.LS);
      //add a couple of newlines to separate records
      ras.writeBytes(PlutoAdminConstants.LS);
      ras.writeBytes(PlutoAdminConstants.LS);
      //replace closing root element
      ras.writeBytes("</portal>" + PlutoAdminConstants.LS);

    } catch (IOException e) {
View Full Code Here

      //end page fragment
      ras.writeBytes("    </fragment><!-- end of 'page' frag -->" + PlutoAdminConstants.LS);
      //add a couple of newlines to separate records
      ras.writeBytes(PlutoAdminConstants.LS);
      ras.writeBytes(PlutoAdminConstants.LS);
      //replace closing root element
      ras.writeBytes("</portal>" + PlutoAdminConstants.LS);

    } catch (IOException e) {
        logError(METHOD_NAME, e);
View Full Code Here

      ras.writeBytes("    </fragment><!-- end of 'page' frag -->" + PlutoAdminConstants.LS);
      //add a couple of newlines to separate records
      ras.writeBytes(PlutoAdminConstants.LS);
      ras.writeBytes(PlutoAdminConstants.LS);
      //replace closing root element
      ras.writeBytes("</portal>" + PlutoAdminConstants.LS);

    } catch (IOException e) {
        logError(METHOD_NAME, e);
        throw new PlutoAdminException(e);
    } finally {
View Full Code Here

  /** create a file of more than 1K size */
  private void createFile( File newFile ) throws IOException {
    newFile.createNewFile();
    RandomAccessFile file = new RandomAccessFile(newFile, "rw");
    file.seek(1024);
    file.writeBytes("du test du test");
    file.getFD().sync();
    file.close();
  }
 
  /** delete a file */
 
View Full Code Here

            {
                RandomAccessFile aWriter = new RandomAccessFile(aFile, "rw");
                for (int i=0; i<m_aList.size();i++)
                {
                    String sLine = getItem(i);
                    aWriter.writeBytes(sLine);
                    aWriter.writeByte((int)'\n');
                }
                aWriter.close();
            }
           
View Full Code Here

    // Insert junk in middle of file. Assumes file is on local disk.
    RandomAccessFile raf = new RandomAccessFile(file.toUri().getPath(), "rw");
    long corruptOffset = raf.length() / 2;
    LOG.info("corrupting " + raf + " at offset " + corruptOffset);
    raf.seek(corruptOffset);
    raf.writeBytes("junkjunkjunkjunkjunkjunkjunkjunk");
    raf.close();

    // Set the option for tolerating corruptions. The read should succeed.
    Configuration tmpConf = new Configuration(conf);
    tmpConf.setBoolean("hive.io.rcfile.tolerate.corruptions", true);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.