Input data streams API, readFully()

Hi all

I was going through the javadoc for the API for the DataInput stream 4.5 in the Java.io package.

Looking at the readFully methods, they claim that:

See the general contract of the readFully  method of DataInput.

I want to know what this means because I am currently using this method to read a DataInputStream in a byteArray and get an EOFException.

I want to know how to use this method, what are its contractual agreement which the

«See the general contract of the method of DataInput readFully "means.»

Anyhelp would be appreciated here,

Thank you

Dan

No problem.. It turns out that the DataInput was in fact an Interface within a single package

If the contract methods readFully is clearly stated in the DataInput interface.

Thanks for any answers that were typed!

Tags: BlackBerry Developers

Similar Questions

  • Create a data streaming from C++ stream and read it in LabView

    Hi all.

    I'm working on a project that is to connect to a tracker of movement and reading data of position and orientation of this in real time. The code to get the data is in c ++, so I decided that the best way to do it would be to create a c++ DLL that contains all the functions necessary to first connect to the device and it reads the data and use the node to call a library function to power the Labview data.

    I have a problem, because, ideally, I would like a continuous flow of data from the code c ++ in Labview, and I don't know how to do this. Put the node function of library call for a while loop seems like an obvious solution, but if I do it this way I'd have to reconnect to the device whenever I get the data, which is quite a bit too slow.

    So my question is, if I created c ++ function that creates a data stream, could I read that in Labview without continually having to call a function? I would rather have only to call a function once, and then read the data stream until a stop command is given.

    I'm using Labview 2010, version 10.0.

    Apologies if the question is badly worded, thank you very much for your help.

    Dave

    dr8086 wrote:

    This method resembles an excellent suggestion, but I have a few questions where I don't think I understood fully.

    I understand the basic principle is to use a call library function node to access a DLL that creates an instance of the device object and passes a pointer too in labview. Then a separate call library function node would pass this pointer to another DLL that could access the device object, update and read the data. This part could be in a while loop, then continue on reading the data until a stop command is given.

    That's all. I'm including some skeleton for example code. I am also including the code because I don't know how you experience multi threading so I show how you can use critical sections to avoid interactions between threads so that they do not lead to questions.

    // exported function to access the devices
    extern "C"  __declspec(dllexport) int __stdcall init(uintptr_t *ptrOut)
    {
        *ptrOut= (uintptr_t)new CDevice();
        return 0;
    }
    
    extern "C"  __declspec(dllexport) int __stdcall get_data(uintptr_t ptr, double vals[], int size)
    {
        return ((CDevice*)ptr)->get_data(vals, size);
    }
    
    extern "C"  __declspec(dllexport) int __stdcall close(uintptr_t ptr, double last_vals[], int size)
    {
        int r= ((CDevice*)ptr)->close();
        ((CDevice*)ptr)->get_data(last_vals, size);
        delete (CDevice*)ptr;
        return r;
    }
    
    // h file
    // Represents a device
    class CDevice
    {
    public:
        virtual ~CDevice();
        int init();
        int get_data(double vals[], int size);
        int close();
    
        // only called by new thread
        int ThreadProc();
    
    private:
        CRITICAL_SECTION    rBufferSafe;    // Needed for thread saftey
        vhtTrackerEmulator *tracker;
        HANDLE              hThread;
        double              buffer[500];
        int                 buffer_used;
        bool                done;       // this HAS to be protected by critical section since 2 threads access it. Use a get/set method with critical sections inside
    }
    
    //cpp file
    
    DWORD WINAPI DeviceProc(LPVOID lpParam)
    {
        ((CDevice*)lpParam)->ThreadProc();      // Call the function to do the work
        return 0;
    }
    
    CDevice::~CDevice()
    {
        DeleteCriticalSection(&rBufferSafe);
    }
    
    int CDevice::init()
    {
        tracker = new vhtTrackerEmulator();
        InitializeCriticalSection(&rBufferSafe);
        buffer_used= 0;
        done= false;
        hThread = CreateThread(NULL, 0, DeviceProc, this, 0, NULL); // this thread will now be saving data to an internal buffer
        return 0;
    }
    
    int CDevice::get_data(double vals[], int size)
    {
        EnterCriticalSection(&rBufferSafe);
        if (vals)   // provides a way to get the current used buffer size
        {
            memcpy(vals, buffer, min(size, buffer_used));
            int len= min(size, buffer_used);
            buffer_used= 0;                 // Whatever wasn't read is erased
        } else  // just return the buffer size
            int len= buffer_used;
        LeaveCriticalSection(&rBufferSafe);
        return len;
    }
    
    int CDevice::close()
    {
        done= true;
        WaitForSingleObject(hThread, INFINITE); // handle timeouts etc.
        delete tracker;
        tracker= NULL;
        return 0;
    }
    
    int CDevice::ThreadProc()
    {
        while (!bdone)
        {
            tracker->update();
            EnterCriticalSection(&rBufferSafe);
            if (buffer_used<500)
                buffer[buffer_used++]= tracker->getRawData(0);
            LeaveCriticalSection(&rBufferSafe);
            Sleep(100);
        }
        return 0;
    }
    

    dr8086 wrote:

    My main concern is that the object can get out of memory or be deallocated since it would not take place to any namespace or whatever it is.

    As you create the object with the new, the object expire not until the dll is unloaded or the process (LabVIEW) closes. If the object will remain valid between condition LabVIEW dll calls not a not unload the dll (who does if the screws are closed). When that happens, I don't know exactly what happens to the active objects (that is, if you forgot to call close), I guess the system recovers the memory, but the device could still be opened.

    What to do to make sure that everything is closed when the dll before I could call unloads close and remove the object is whenever I create a new object in the dll that I add to a list when the dll is unloaded, if the object is still on the list, that I'm deleting it.

    dr8086 wrote:

    I also have a more general question of programming on the purpose of the buffer. The buffer would essentially be a large table of position values, which are stored until they can be read in the rest of the VI?

    Yes, see the code example.

    However, according to the frequency with which you need to collect data from the device you have this buffer at all. That is, if take you a sample on every 100ms, then you can remove all threads and buffer related functions and instead to read data from the read feature itself like this:

    double CDevice::get_data()
    {
        tracker->update();
        return tracker->getRawData(0);
    }
    

    Because you need only a buffer and a separate if thread you collect data at a high frequency and you can not lose any data.

    Matt

  • Reading input data file

    Dear all,

    I wonder if someone helps me.

    I have a labview program which I am using right now. At this point, I need to read an input (dat or txt or excel) file in real time.

    for example, here's my data entry (2 columns and 5 rows):

    1.2 2.2

    2.3 2.3

    3.05 3.3

    4.3 4.4

    5.2 5.5

    for example in evry second I want to read a jut line and do the math. in this way, in real time, I can read each line one by one.

    How can I do?

    Kind regards

    Mehdi

    For the text, simply use the reading of spreadsheet. Take exit 2D and wire of a loop for. put a wait of 1 second inside the loop and you are finished.

  • Unable to read the security descriptors data stream

    Whenever I start my computer runs CHKDSK - it says checking file system on E: and then he said that it should be checked for consistency. It works until stage 3 when he says 'impossible to read the security descriptors data stream' how to fix this?

    I tried chkdsk e:/r and it runs before step 3 when I get the "unable to read the security descriptors data stream" and it goes no further.

    I also tried fsutil dirty query e:- but it says something about a parameter incorrect and not if the volume is dirty or clean.

    Then I tried chkdsk e:/f/x - that always gives me the same mistake about it being an incorrect setting.

    As far as I know there is absolutely nothing on E:, I didn't even know that there was an additional drive. Right now I have it turned off so that I can use my computer. It seems to work fine without it. I read an article that said that if I can't fix e: with chkdsk which I have to do a low-level format of the reader? What's my next step? And I can do without the XP disc?

    The syntax

    fsutil dirty query e:

    is correct (except, of course, you try to use from the Recovery Console, where the fsutil command is not available).  Are you logged on as a user with administrative rights when you use fsutil?

    Similarly, the switches /f and/x are not available for chkdsk in the Recovery Console.

    See Recovery Console controls.

    Click on desktop then right-click on E: drive icon and select Properties.  What is indicated for:

    • File system
    • Space used
    • Free space
    • Capacity

    Now double click the icon for E: are shown files?  If not, click Tools > Folder Options > view and select the radio button "Show hidden files and folders" and uncheck "Hide protected files (recommended) operating system.  Now that you see all the files?

    Everything you read 'low level of shaped' is nonsense.  Any modern PC drive cannot be low level formatted by end users.  You can read this, but there is really no necessary even to "zero fill" your drive E: http://seagate.custkb.com/seagate/crm/selfservice/search.jsp?DocId=203931 (I have not checked to see if the WD tools rescuer has similar characteristics to SeaTools for DOS).

    If you are convinced that there is nothing of value on E (for example, installation of backup or restore), you can either format by right-clicking on the drive icon in my computer and selecting "format" or you can start disk management as described previously and use either in electronic format or delete the partition completely.  If you delete the partition, space becomes "unallocated".

    Because I guess C is your system drive (where Windows is), you may be able to use the diskpart tool to extend the partition F to use the unallocated space left if you decide to remove E well it's much easier (and safer) to do with disk management third-party tools such as Easeus Partition Manager free : http://www.partition-tool.com/personal.htm

  • Remove the first 5 blocks in a data stream

    Hi all

    I have a problem to remove the first 5 blocks in the data stream. My sampling rate is 1 s, block size is 1 and the entrance is the module «the ddf file read»

    I use the following modules for an average analysis 30 years running.

    [read the folder]---> [Formule1] -> [set variable] -> [formula2]

    |                 ^

    --> [time]-|

    module parameter

    ======                =========

    delay of 30

    Formula1 ${var_1} + in (0) - in (1)

    the value of variable ${var_1}

    Formula2 in (0) / 30

    This configuration is used for channels 13 and one of these channels is used for purposes of triggering. Due to the nature of the variable defined and read in the underlinedmodules, the trigger sequence is delayed for 2 sec. Since I used the trigger to collect the last returns average of each channel, it is now mixed with 2 sec for the next round.

    My question is: is there a way to reduce say 5 blocks of data from the stream? Please help and have a nice day

    Look at the SEPARATE module in the Group of data reduction.

    It allows you to set up an initial leap, then a current break.

    To do this, you want to jump 5 blocks once, does through go zero blocks... who spends the first five and then release all the data blocks of subsequence.

  • network data stream

    Good afternoon

    I need to send the data generated in the vi, by network data stream.

    The problem is that I found no example that does something similar, and this is my first time using Activex with Labview. Can someone explain me how to send Activex data via the network stream please and if possible help me find a solution to the attached vi.

    I think I need to convert the data somehow after control of the room before using the writing and reading items, I tried with strings and arrays unsucessfully, I really think I'm missing something.

    Thank you in advance!

    Erika

    Erika,

    What do you think?  You try to play an .avi file, a .mpg or what?  IMAQdx has functions that can play video and output files 'images', and you can deliver these images via TCP/IP on another computer using network flow.  Indeed, there are cameras that capture video and output via TCP/IP - IMAQdx is used to capture the image directly from the camera and can view or save a file from .avi (for example).

    You have the Vision Module installed on your system?  In your Palette of block diagram, it will appear under the Vision and movement and should include IMAQ (or IMAQdx) and utilities of Vision (which contains the Palette under files to make the reads and writes of video files).  See if you can use this to display your video...

    Bob Schor

  • Input data for digital indicator tab does not exist

    Hello

    I'm trying to define the range of data for the numerical indicators on LabVIEW 10.0.1. For some reason when I go into the properties of my digital indicator, there is no input data tab as explained on the Web site of NOR: http://zone.ni.com/reference/en-XX/help/371361H-01/lvhowto/changing_data_ranges_of_nu/. In addition, in the tab data type, there is a section for the range, but everything is gray. Any help is appreciated. Thank you

    Dig up a very, very old manual (1996!) isn't all that productive. If you want to restrict the output, just use the function in the range and force.

  • Type of input data for the graph waveform

    Waveform graphs do not change the type of input data according to the wire. When I create a new chart that is set to double data type and does not change what I connect to waveform, so I copy graphics to another VI for appropriate indication. But the graphics don't accept complex data. How can I change the type of input data?

    The graphics in vi you have posted behave properly on my machine.

    Change according to the type of data that connect you to them.

    Maybe something wrong with your installation?

  • Digital acquisition of data streams

    Hello

    I tried (unsuccessfully) to acquire digital data of a sensor laboratory.  The Guide from the manufacturer:

    "When the excitement of voltage, DTC Decagon sensor makes a measurement.  Three measurement values are passed for about 140 ms of excitement to the data logger as a character of flow series of ASCII.  The series is 1200 asynchronous baud with 8 data bits, no parity and one stop bit.  The voltage levels are 0-3, 6V and logical levels are (low active) TTL.  The power must be removed and repeated his request for a new set of values to pass.  The ASCII data stream contains three numbers separated by spaces.  The first number is the depth of the water in mm, the second number is the temperature in degrees Celsius, with a resolution of 0.1 degree C, and the third number is the electrical conductivity in dS/m, with a resolution of 1 dS/m.  A carriage return follows the three digits, then the character ' t "", which indicates that it is a sensor DTC, and then a control character, and finally a carriage return and supply line. ' "

    My attached VI is a little dubious-it probably looks like something that someone used for analog signals may create.  However, I was hoping it would be enough of a starting point for a more wise to work with LabVIEWer.

    Thank you very much

    Lacksagoo

    The guide said in reality as a data acquisition card OR is the same as a data logger. I've never associated the two as being the same. What I think about a data logger is an autonomous instrument.

    Looking for a more details in your original post, the voltage levels are not standard. You may need a shifter level or need to find a USB-RS232 adapter for TTL levels.

  • Installation of Microsoft - other hardware - HID Non-User Input data filter (KB 911895) (updated 1 of 15)... failed!

    I can't download this updates?

    Download update of security suites for Microsoft Office 2007 (KB2596672) (updated 7-15)... done!

    Download update of security suites for Microsoft Office 2007 (KB2597162) (update 8 of 15)... done!

    Download a security update for Microsoft Office Word 2007 (KB2596917) (Update 9 of 15)... done!

    Download a security update for Microsoft Office Excel 2007 (KB2597161) (updated 10 15)... done!

    Download a security update for Microsoft Silverlight (KB2636927) (11-15 updated)... done!

    Download update for filter junk e-mail in Microsoft Office Outlook 2007 (KB2687310) (updated 12 of 15)... done!

    Download update for Microsoft Office Outlook 2007 (KB2596598) (updated 13 of 15)... done!

    Download a security update for Microsoft Office InfoPath 2007 (KB2596786) (updated 14 15)... done!

    Download update of security suites for Microsoft Office 2007 (KB2596744) (update 15 of 15)... done!

    Initializing installation... done!

    Installation of Microsoft - other hardware - HID Non-User Input data filter (KB 911895) (updated 1 of 15)... failed!

    Install the update of security suites for Microsoft Office 2007 (KB2596871) (update 2 of 15)... failed!

    Install the update of security suites for Microsoft Office 2007 (KB2598041) (update 3 of 15)... failed!

    Install the update of security suites for Microsoft Office 2007 (KB2596880) (update 4 of 15)... failed!

    Install the update of security suites for Microsoft Office 2007 (KB2597969) (update 5 of 15)... failed!

    Install the update of security suites for Microsoft Office 2007 (KB2596792) (update 6 of 15)... failed!

    Installation of update of security suites for Microsoft Office 2007 (KB2596672) (updated 7 of 15)...

    They all failed

    -Other hardware - Microsoft HID Non-User Input data filter (KB 911895)

    Update of security suites for Microsoft Office 2007 (KB2596871)

    Update of security suites for Microsoft Office 2007 (KB2598041)

    Update of security suites for Microsoft Office 2007 (KB2596880)

    Update of security suites for Microsoft Office 2007 (KB2597969)

    Update of security suites for Microsoft Office 2007 (KB2596792)

    Update of security suites for Microsoft Office 2007 (KB2596672)

    Update of security suites for Microsoft Office 2007 (KB2597162)

    Update of security for Microsoft Office Word 2007 (KB2596917)

    Update of security for Microsoft Office Excel 2007 (KB2597161)

    Update for the filter of junk e-mail in Outlook 2007 (KB2687310)

    Update for Microsoft Office Outlook 2007 (KB2596598)

    Update of security for Microsoft Office InfoPath 2007 (KB2596786)

    Update of security suites for Microsoft Office 2007 (KB2596744)

    Thank you

    Tip: Get a driver updates you really need from the download page of the manufacturer of the device or the computer only, NEVER through Windows Update (i.e., hide the driver updates available through Windows Update).

    ACTIONS

    1. open Internet Explorer (only!) to http://support.microsoft.com/kb/910336 [ignore the title & symptoms].

    1B. IMPORTANT!-online make disappear/close theTroubleshooting Windows Update tool ""pop up! "   " -then...

    1 c. ignoring "not recommended" or similar warnings, difficulty running it 50202 DEFAULT modes and AGGRESSIVE. [1]

    2 reset.

    3. open Internet Explorer (only!) at http://windowsupdate.microsoft.com . Select CUSTOM and scan | Installation of Security updates (e.g., KB2596871;) KB2597162) available now.

    -Online if an update root certificates (KB931125) is listed under the category of updates software optional on the left side of the window of scan results, install it to enjoy greater security of IE8.

    -Online also install the junk e-mail Filter Outlook update (KB2687310) as well as Update for Windows XP (KB971029) if it is offered.

    -Online Tip: do NOT install any other optional software updates or upgrades optional equipment (e.g., KB911895) - just hide them ("don't show me this update") all.

    4. in response to this post with a status report.

  • Get errors for the user input data filter no KB 911895 HID

    OT: iI have windows xp S/P 3 installed also apple i pad I get errors for the user input data filter no KB 911895 HID
    What should I do to get rid of this popup that wizzard windows keeps giving me?

    Hi Graybeard,

    What is the exact error message you get?

    HID Non-User Input data filter is an optional update. I suggest you try the steps from the following link:

    The screen saver does not start after the installation of a wireless pointing device
    http://support.Microsoft.com/kb/913405

    What version of the operating system Windows am I running?
    http://Windows.Microsoft.com/en-us/Windows7/help/which-version-of-the-Windows-operating-system-am-i-running

    Troubleshooting Windows Update or Microsoft Update when you are repeatedly offered an update
    http://support.Microsoft.com/kb/910339

  • How can I uninstall or repair and I HID Non-User Input data filter?

    (He was installed by windows update & failed because the "fatal error", it continualy attempts to install start-up & fails.) There NOW in some SORT NOW picked UP MY wireless keyboard Microsoft THAT DO WORK MORE, AS THE PROGRAM CACHE IS DEFECTIVE!  When I stop & reboot, the KEYBOARD is NON-OPERATIONAL & I can't GET THE PIN TO LOGON! In desperation I dug an old logitech keyboard and eventually be able to log on to come here for HELP, someone please. Sorry for the cries of joy, (capitals), but I had a full head of hair when I started but I'm now almost bald!
    Brian McGDR

    Hi BrianMcGDR,

    1. When you are unable to install the Microsoft HID Non-User Input update data filter?

    2. What is the full error message you received during the installation of this update?

    3. do you have security software installed on the computer?

    4. What is the model number of the keyboard? What happens when you try to connect the keyboard to the computer?

    The update of the Microsoft HID Non-User Input data filter must be installed if you experience the problem that is mentioned in the Microsoft article below.

    The screen saver does not start after the installation of a wireless pointing device

    http://support.Microsoft.com/kb/913405

    I suggest that you download and install the latest drivers for keyboard, check if it helps.

    http://www.Microsoft.com/hardware/en-us/downloads

    See the update history for the exact error for failure put up-to-date and after return with details.

    (a) open Windows Update by clicking Start , all programsand then click Windows Update.

    (b) in the left pane, click view update history.

    (c) to view more information about an update, double-click it.

  • What is Microsoft - other hardware - HID Non-User Input data filter (KB 911895)?

    What is Microsoft - other hardware - HID Non-User Input data filter (KB 911895)?

    and what is it for?

    What is Microsoft - other hardware - HID Non-User Input data filter (KB 911895)?

    and what is it for?

    In simple terms...

    It is mainly for wireless devices that you have installed on your computer, such as keyboards and wireless mouse.

    If you use the hardware wireless with your computer, the update is necessary. Without it, your computer won't be able to go to standby mode because the wireless hardware will keep the computer awake.

  • The selected data source is read-only

    Someone knows how to solve this 'problem '.

    The selected data source is read-only. You cannot change the view configuration.

    Thanks in advance.

    My solution to this has been reset in the field of data and download information again. I know that it is not best practice but it works

  • How to restrict the scope of the EU change when the input data are not available?

    Hi Experts,

    I have a user enter-able (EU) field in the Section. When the tag input XML contains data for this field, then the value must print in this area and it is not editable.
    If the input data are not available only that one time that the field of the EU must be editable.

    Any thoughts?

    I tried like below,

    Domain name creation: UE_CompName
    Length: 15
    Type: alphanumeric
    Rule: XDD
    Source name:! Transaction/Compname
    under PreEdit,.
    module: DALW32
    Procedure: procedure of desired
    Information: CALL ("UE_CHECK")

    like that, I've updated in the field properties.

    Content of UE_CHECK DAL below,

    CurrFieldName = Fieldname()
    CurrFieldData = @("CurrFieldName")

    IF CurrFieldData! = « »
    SetProtect ("CurrFieldName")
    END
    But it does not work... Pls help me to do this...

    I assume that the 'mapping' occurs during a batch operation (Gendata) through any rule the XDD defined for this field. In the batch, pre and Post Edit calculations do not. This feature is related to the WIP/entry. What you can do is to add a level section - PostImageDAL rule to call your script and protect your land once it was located batch of your operation.

    In FAP that contains that field, add the PostImageDAL rule in the property of the rules in the Section box. In the data box, do call your script.
    Your script is a bit wrong, it seems you were trying to get the 'current' domain name and then check the value of fields. Drop the part and simply name your field in the string in quotation marks in the @ () function and the SetProtect.

Maybe you are looking for

  • When I close the tabs, it is said there are several open tabs I have open

    For example if I have 5 tabs open and I try to close them, he asks me if I want to close all tabs (not 5) 6. He always is + 1 more open tab. Why is this?

  • Is it possible to manually reassign a BSD name on a disc?

    Hi all I'm running a dual-boot configuration (via Bootcamp) and after initially all set up, had to temporarily set up another partition on the hard drive with my OS X and Windows/Bootcamp partition. Do seem so have reassigned my Bootcamp partition to

  • transfer to SD card

    Hi my laptop is pre 2008 still faster than the sandisk card will not read on my drive tho. can I use the charging port to supply power on my yoga Tablet 2 10 inch portable USB to transfer to the hd?

  • HEXAGONAL problem

    Hi again, I could really do with some help regarding sending the commands by using the code display string. Basically, I need to send a string of HEX 02 08 00 00 00 20 00 03 xx xx to device bluetooth as a command. The xx represents the changing data

  • ear phone not working not but plugged

    My headphones work, but in the middle of a conversation with a friend, they stopped just leave the sound come through. my lap top.