Sponsored Content
Top Forums Programming Java not getting in expected way Post 303017948 by jim mcnamara on Friday 25th of May 2018 09:37:28 AM
Old 05-25-2018
Hint: Your variable names made it hard for me to read your code. Variable names that indicate what they are -- really help. a,b,c,d,e do not convey much.

Code:
b.write(c,1,4);

This creates what you see in the file. "\n" works to solve your problem - watch out for windows OS.

So you need another call to write to c with one character, "\n".

Here is a lot more advanced discussion - note that java versions have different limitation on the use of writing to numbered file descriptors - depends on version and OS.
Using a numbered file descriptor from Java - Stack Overflow
 

We Also Found This Discussion For You

1. Programming

Not getting O/P in expected way-java

through below code i am trying to write a content in a file and then reading the same file my code is running file but is not getting in proper way import java.io.*; class A1 { public static void main (String agrs) { byte b = {'a','e','i','o','u'}; String s = "King Maker"; try {... (7 Replies)
Discussion started by: scriptor
7 Replies
AIRPORT-CONFIG(1)					      General Commands Manual						 AIRPORT-CONFIG(1)

NAME
airport-config - Configurator for the original Apple AirPort Base Station ("Graphite") and the Lucent RG-1000 base station SYNOPSIS
airport-config DESCRIPTION
airport-config allows you to manage your AirPort base station, just like the AirPort software on Mac OS X. OPTIONS
airport-config accepts no command-line options. airport-config is a wrapper script around the AirportBaseStationConfigurator.jar jar file located in /usr/share/java/airport-utils. You can set the JAVACMD environment variable to use a specific JVM instead of the one chosen by the wrapper script. Set the DEBUG environ- ment variable to 1 to get the debug output from the wrapper script. ENVIRONMENT VARIABLES
DEBUG Set this variable to 1 to get the debug output from the wrapper script. JAVACMD The full path to the Java Virtual Machine to use. By default, the wrapper uses JAVACMD; if it is not set, it looks for JAVA_BINDIR/java, then for JAVA_HOME/bin/java before looking for a java executable in the PATH. In the latter case, the JVM used can be configured using the Debian alternatives system (see update-alternatives(8)). JAVA_HOME The full path where your JDK/JRE is installed. JAVA_BINDIR The full path to the directory where the java executable is located. JAVA_ARGS Extra command-line arguments to be passed to the Java Virtual Machine. AUTHOR
airport-config was written by Jon Sevy <jsevy@cs.drexel.edu>. This manual page was written by Julien BLACHE <jblache@debian.org>, for the Debian project (but may be used by others). May 20, 2006 AIRPORT-CONFIG(1)
All times are GMT -4. The time now is 09:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy