Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 7 of 7

Thread: Java coding for block division

  1. #1
    Junior Member
    Join Date
    Feb 2014
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Java coding for block division

    Sir/ Madam,
    I'm K.Saranya,ME Scholar. Now i'm doing project in area of "Cryptography and Network security". I'm having a file with binary Unicode (mean file contain Unicode value of corresponding data (text file)), want to divide that as blocks with the size of 144bits. I don't know how to code for this so please kindly help me.


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    22,343
    Thanks
    56
    Thanked 2,376 Times in 2,346 Posts

    Default Re: Java coding for block division

    How many bytes in 144 bits? Can you write code that reads that number of bytes from the file? There are methods for reading bytes into arrays.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Feb 2014
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Java coding for block division

    144bits means 18bytes.

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    22,343
    Thanks
    56
    Thanked 2,376 Times in 2,346 Posts

    Default Re: Java coding for block division

    Do you have a problem reading bytes from a file 18 at a time?
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Junior Member
    Join Date
    Feb 2014
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Java coding for block division

    Yes. I want to read bytes from left to right and also want to split it as 18bytes of blocks. After this process i want to work with that each block separately. So please help me. I'm just a beginner to Java.

  6. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    22,343
    Thanks
    56
    Thanked 2,376 Times in 2,346 Posts

    Default Re: Java coding for block division

    Look at the FileInputStream class. It has methods to read bytes from a file.
    If you don't understand my answer, don't ignore it, ask a question.

  7. #7
    Junior Member
    Join Date
    Feb 2014
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Java coding for block division

    K thank you so much... I ll check it...

Similar Threads

  1. Synchronized block in java
    By me_shankara in forum What's Wrong With My Code?
    Replies: 2
    Last Post: December 12th, 2012, 11:43 PM
  2. synchronized block in java
    By me_shankara in forum Threads
    Replies: 1
    Last Post: December 3rd, 2012, 11:04 PM
  3. Replies: 2
    Last Post: February 19th, 2012, 07:36 AM
  4. Java sliding block puzzle issues
    By Vesper in forum What's Wrong With My Code?
    Replies: 15
    Last Post: April 11th, 2011, 08:30 AM
  5. Creating Block cipher without the use of inbuilt java funcs
    By fortune2k in forum Algorithms & Recursion
    Replies: 0
    Last Post: November 15th, 2010, 09:43 AM