Can i Read an Object[Hashtable] if i am using BufferReader
Hi EveryOne,
I am writing a Java Chat Program, an it seams that i can not read an Object[Hashtable] from the BufferReader, Do you thing there is an easy way around it. rather then me change ther BufferReader everywhere. Please let me know....
Thanks
Hi EveryOne,
I am writing a Java Chat Program, an it seams that
at i can not read an Object[Hashtable] from the
BufferReader, Do you thing there is an easy way around
it. rather then me change ther BufferReader
everywhere. Please let me know....
Thanks-------------------------------------------------------------------
Can Someone please reply to these Question it is kind of argent for me to know these....
Thanks
Similar Messages
-
I can't read a Object from file, Please help me
i want to write a Object into File. this is code of Object
class objStoreCus implements Comparable, Serializable
String customerID = new String();
String customerName = new String();
String customerEmail = new String();
objStoreCus(String cusID, String cusName, String cusEmail)
customerID = cusID;
customerName = cusName;
customerEmail = cusEmail;
objStoreCus(){}
public int compareTo(Object o)
objStoreCus oS = new objStoreCus();
oS = (objStoreCus)o;
return(customerEmail.compareTo(oS.customerEmail));
private void writeObject(ObjectOutputStream s) throws IOException {
s.defaultWriteObject();
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
try
s.defaultReadObject();
}catch(IOException ie){throw new IOException();}
catch(ClassNotFoundException cnt){throw new ClassNotFoundException();}
And I was wrote above Object into File by this code :+
FileOutputStream fos;
ObjectOutputStream oos;
FileInputStream fis;
ObjectInputStream ois;
public void writeObjToFile(objStoreCus obj)
try
fos = new FileOutputStream("Exrcise3.ex3", true);
}catch(FileNotFoundException fnfe){}
try
oos = new ObjectOutputStream(fos);
//ghi doi tuong vao file
oos.writeObject(obj);
//dong stream
oos.close();
fos.close();
}catch(IOException ie){}
But i can't read above Object from file. allway have a Exception occur "StreamCorruptedException".
this is code read Object form file :
*parameter is ArrayList will be store Object from file.
public void readObjFromFile(ArrayList al)
try
fis = new FileInputStream("Exrcise3.ex3");
}catch(FileNotFoundException fnfe){}
try
ois = new ObjectInputStream(fis);
while(true)
try
objStoreCus osc = new objStoreCus();
osc = (objStoreCus)ois.readObject();
System.out.println(osc.customerEmail);
}catch(Exception e)
e.printStackTrace();
//System.out.println();
break;
ois.close();
fis.close();
}catch(IOException ie){}
}Problem lies in
os = new FileOutputStream("Exrcise3.ex3", true);
You are trying to append to that file, You should always use new file to serialize objects.
os = new FileOutputStream("Exrcise3.ex3");
Try with above line. -
How to read Java Object message from JMS Queue using JMS Adapter .
Dear All,
In my scenario i have to read a java object message from JMS Queue . I tried by using the JMS Adaper ,but i am not getting any Payload . Can any one tell me is there any special settings for JMS Adapter to read the Java Object message .
I am able to read the Message successfully thru JMS Adapter but in SXMB_MONI it is not showing any payload .
I also went in Message monitoring but i am getting this type of message in Sender JMS Adapter in Audit Log.
JMS Message ID XXXXX Message Type Null unknown.Payload can not be read and will be empty.
JMS Message ID XXXXX Payload Empty can not read.
Please Help.
LateefHi,
As far as i know, JMS Object Messages is not supported by XI JMS adapter.
you need to have the JMS provider to transform the message to bytes messages.
(Refer to SAP note 856346) -
Can not read authorization object in execute Query
hello:
Now I create a authorization object ZSALR, include Activity,Sales Group,Sales Office. Activity = Display ,Execute;
When Sales Group = S_N and Sale Office = S_SX. I execute Query restrict by Sales Group and Sale Office.
Warning message"You do not have authorization to read to ZSALR"
When Sales Group = * and Sale Office = *. I execute Query OK, and display all infomation. and explain "S_N" and "S_SX" can display in middle part in Query.
Hope someone can tell me how to solve the error.
Regards&Thanks!This occurs because , something in the class has changed . Every class has a serial id associated with . It is unique. even if a member var changes , this id will change .
You are trying to deserialize a serialised object with a changed version of the class .
You can see the serial id using "serialver" utility provided with jdk in bin directory -
Can't read special characters in an excel file using JDBC
Hi! I 've a code to read an excel file using JDBC-ODBC bridge. I can read the values, but any special characters is readed wrong, just symbols. The special characters are of spanish language. This is my code:
Locale currentLocale;
currentLocale = new Locale("es", "MX");
Locale.setDefault(currentLocale);
Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" );
c = DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Excel Driver (*.xls)};DBQ=comisionesperfiles.xls");
stmnt = c.createStatement();
String query = "Select * from [Hoja1$]" ;
ResultSet rs = stmnt.executeQuery( query );
while( rs.next() ){
String valor = rs.getString(2) ;
if(valor != null && !"null".equalsIgnoreCase(valor)){
if(!comisiones.contains(valor)){
System.out.println(valor);
comisiones.add( valor );
rs.close();
stmnt.close();As you can see, I've tried to set the locale, but it didn't work.
I'm using Excel 2003, Java Version 1.4.2_07 and Windows XP Professional (in latin american spanish).
Hope someone can help me!FYI: Apache's POI can read/write Excel files in Java:
http://jakarta.apache.org/poi/index.html -
Can't read a DVD anymore that I was using to create an image
I was trying to create a copy of a DVD, but creating the image failed since I was accidentally was creating a dmg rather than a cdr. I was able to eject the DVD but now it can't be read anywhere, it shows as a blank DVD-R. This is my log, I would appreciate any help to recover the only copy I had of this DVD
2011-03-26 21:52:40 -0700: Disk Utility started.
2011-03-26 21:54:16 -0700: Creating Image “DVD_ZAYZ1.dmg”
2011-03-26 21:55:05 -0700: Preparing imaging engine…
2011-03-26 21:56:25 -0700: Reading NEW (Apple_UDF : 0)…
2011-03-26 21:57:13 -0700: Eject of “NEW” failed
2011-03-26 21:57:59 -0700: Mount of “NEW” failed
2011-03-26 21:58:22 -0700: Verifying volume “NEW”
2011-03-26 21:58:22 -0700: Starting verification tool:
2011-03-26 21:58:44 -0700: fsck_udf: cannot probe and mount /dev/disk1: No such file or directory
2011-03-26 21:58:44 -0700: Error: This disk needs to be repaired. Click Repair Disk.2011-03-26 21:58:44 -0700:
2011-03-26 21:58:44 -0700: Disk Utility stopped verifying “HL-DT-ST DVDRW GA11N”: This disk needs to be repaired. Click Repair Disk.
2011-03-26 21:58:44 -0700:
2011-03-26 21:59:05 -0700: Unable to create “DVD_ZAYZ1.dmg.” (Input/output error)
2011-03-26 22:02:14 -0700: Disk Utility started.
2011-03-26 22:02:24 -0700:
Name : HL-DT-ST DVDRW GA11N
Type : Optical Device
Disk Identifier : disk1
Device Name : HL-DT-ST DVDRW GA11N Media
Connection Bus : SATA
Connection Type : Internal
Device Tree : IODeviceTree:/PCI0@0/SATA@B/PRT1@1/PMP@0
Total Capacity : 0 Bytes
Disk Number : 1
Partition Number : 0
Burn Support : Apple Shipping
Entry Path : disk1
Writes CD : Yes
Writes DVD : Yes
Media is present : Yes
Media is busy : No
Media Type : DVD-R
Media is blank : Yes
Media is appendable : Yes
Media is overwritable : Yes
Media is erasable : No
Media is reserved : No
Capabilities : Click for more information
2011-03-26 22:05:43 -0700: Disk Utility started.Actually, I can still be read by a DVD player but not from my iMAC or my PC
-
How can i read pwm signals from a rc receiver using myrio??
Hello, i bound a transmitter (rc remote control) with a receiver which i connected it (the signal's pin) to the digital port on myrio. It showed me a boolean indicator, and it wasn't turning on the whole time even when i moved a cursor on the transmitter. When i put a time delay of 1sec in the code the results started to show true on some positions of the throtlle. Can anyone tell me how can i interpret those result to create signal conditioning and control some motors?? thank u all in advance
This is the point in the phone conversation when the mechanic tells the customer, "Why don't you bring your car in?"
Please upload your code so we can help you figure out what's wrong.
Bill
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all. -
How can I read an audio file and brodcast it using NI RFSG?
Hi everybody,
I'm designing a wireless audio signal simulation system that will read an audio signal from a file and modulate the signal using NI 5671 RFSG, then broadcast it to be received at an NI 5660 RFSA.
All I need is some guidance from you guys. Some related examples would be of great help since I'm a new user of NI hardwares and software.
Thanks in advance.
Muslim,
Communication Engineering Student,
International Islamic University Malaysia.Hi,
I’m going to
help here since Paul is out of the office, so far you have been able to use
Paul’s example to generate a signal from a Wav File, right? I have a question:
why did you combine some of the parts of the (fm-modulation) with the generate
FM signal from WAV file if the example Paul attached is already modulating the
signal?
I have another question on the part
that you are stuck when reading the file, do you want to play it back through
your speakers or you just want to be able to see the array of samples? Have you
seen the example “MT niRFSA Demodulate FM.vi”? And if so why it does not help? Here
is another example for FM modulation: Sound File Frequency
Modulated Generation using NI-567x I would like to let you know that all
those examples Paul and I are giving you are located at our website most are
free and you may find them yourself; if you have the necessary drivers and
toolkits installed you should be good to go. “The examples
available do not show what I'm searching for” What are you
searching for? What type of analysis do you need to perform?
Remember
that in the RFSA part of your project what you are going to be receiving will
be an array that contains all the points of your data not a WAV file. I will suggest trying to
run both FM example the RFSG and RFSA with no modification for a better
understanding of what is happening.
I hope it helps
Jaime Hoffiz
National Instruments
Product Expert
Digital Multimeters and LCR Meters -
How can I read realtime data from a data socket using DIAdem
I am currently routing data from an instrument using LabView 7.1 to a data socket. I was trying to figure out how to access that data in real time in DIAdem through the data socket. Another option would be to use the downloaded LabView/DIAdem VI package, but I haven't figured out how to get that to work either, despite the forums here. I would prefer to access it through the data socket, if possible, as the amount of information being transferred is negligable (a string and a double).
Thank you,
Sinan SutcuYou have to use one of the ScriptDAC blocks. In your case, as you would like to fetch data from a LabVIEW vi, choose the out of the driver input palette. Inside the configuration dialog you can generate a sample script, which is then copied to the windows clipboard. It contains a lot of function prototypes which will be automatically called later during the measurement.
Basically, the init functions are called during the start of the measurement - here you should connect to the activeX server, the deinit functions are called when stopping the measurement - disconnect from the server here.
Then there is the function SFD_Readchannel, which is called once for eych tact and each channel you configured. Here, you should exchange the data with your VI.
I am attatching an example I wrote to control a LabVIEW vi (doing a counter output operation)- that is why the data exchange works the other way around, but I hope it explains the principle.
Additionally I am adding documentation about the ScriptDAC driver interface.
Regards
Ingo Schumacher
Systems Engineer Sound&VibrationNational Instruments Germany
Attachments:
MultiCounterOut.zip 995 KB
Script DAC Driver.zip 734 KB -
How can i read Object serialized in delphi ?
anyone has got any ideas how can i read serialized object created by delphi and was serialized in a file
zeda wrote:
Peter__Lawrey wrote:
To my knowledge you need a Delphi program to read it.so there is no 3rd party plugin or so?Not that I know of. You could learn more about how Delphi serializes objects, and work back from there. But you're probably much better off taking a hint from Peter and serializing to XML in the first place. This sort of problem is the exact kind of thing XML is good at solving -
How to read multiple objects stored in a file.
Hi,
there is a file on which multiple object have been written.
Now while reading it back, is it necessary to read the objects in the same sequence in which they were written or i can randomly read any object?
thanx
deepak sainiI suppose you could use random file access, but you would need to keep track of where you put the objects.
-
How can we read filenames from a specific folder
Hi forum,
I have a situation that, there are several files coming daily in a specific folder.
I want to read filenames from that folder and want to get that filename in a variable.
That filename contains account nos. which I need for further processing.
Now, how can we read filenames from a specific folder with using Oracle PL/SQL Procedure?
Please suggest.
Thanks & regards,
KiranIf you are on 10g (not sure which exact release I'm afraid) you might look at Chris Poole's XUTL_FINDFILES that lists the files in a directory using PL/SQL and DBMS_BACKUP_RESTORE.SEARCHFILES (all a bit undocumented as it seems to be provided as part of rman).
The conventional (i.e. supported) approach is to use a Java stored procedure - there is an example on AskTom.
Message was edited by:
William Robertson -
How can I read the PXI-Chassis-Type (LabWindows/CVI)?
How can I read the PXI-Chassis-Type?
I use in different test-stands different PXI/SCXI-Chassis for the same project. For example: Some test-stands have a PXI/SCXI-1052-Chassis, others have a PXI-1033 and a SCXI-1000 Chassis. Because I have to use different DIO-Ports (Ports 0.0, 0.1... are reserved for internal communication between the 1033 and the 1000-Chassis) I want to read the used devices.
I think one way is to use the registry-entries, but I'm not sure...
My current LabWindows/CVI- version is 8.5.1.
Thanks for your ideas!
Jagger_HKGHello Jagger_HKG,
you could use the NI System Configuration API.
Kind regards,
Robert H
NI Germany -
TypeError: can't access dead object
I upgraded to Firefox 15. Since then i get this error - TypeError: can't access dead object
I am unable to use Firefox anymore as when I open it, this message appears and I can't use the browser. Closing the dialog box or clicking ok only causes it to immediately reopen.
Is there a fix for this or can I revert back to the previous version of Firefox and if so, how and where?This issue can be caused by an extension that isn't working properly.
Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
*Do not click the Reset button on the Safe mode start window or otherwise make changes.
*https://support.mozilla.org/kb/Safe+Mode
*https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes -
How to read a table from a word file, using HWPF
How can I read a table from a Word file using HWPF?
I looked in API and Table class doesn't seem to have a constructor... very very strange for me. pls helpthe constructor is HWPFDocument = new HWPFDocument(/*file*/)
Here is the API for that
http://poi.apache.org/apidocs/org/apache/poi/hwpf/HWPFDocument.html
Also here is another link to something that might help you more with tables
http://www.aspose.com/Community/forums/thread/79182.aspx
Maybe you are looking for
-
Want to create a new folder in Windows using Java?
Hello everyone!!! The situation is I want to create a folder using Java. What I am doing is I am asking client to upload files.If the client is uploading for the first time a new folder is created on the server side and all the files related with tha
-
HELP PLEASE
-
Clearing G/L Subaccount Open Items?
When posting manual bank statements, the individual amounts on the statements do not clear against subaccount amounts. This is due in part because of batch processing of incoming and outgoing payments. Ie. Deposit 150 checks, total deposit $225,00
-
Need to fetch the last record/row from a table
Hi, I have a requirement like fetching the closing balance of the last record of the table and inserting the same into the opening balance of the immediatetly created next record. In simple words, I need to fetch a value from the last row of the reco
-
Is it possible to change 'camera data' info?
I think I know the answer, but: I'm using a favourite 'framing template' in which I open a new image, copy and paste into the framing template which has had many automations run for watermark, signature, naming, etc., and then when I post to Flickr f